2016-03-11 75 views
1

確實知道哪裏可以找到這樣一個關鍵圖?尋找QWERTZ KEYBOARD MAP在自己的操作系統中使用

我已經有一個(我們的關鍵地圖),但我需要德國Qwertz之一。

例如,這是美國的一個:

#define STANDARD_KEYMAP_DEF { 0, 0x1B, '1', '2', '3', '4', '5' , '6', \ 
          '7', '8', '9', '0', '-', '^', '\b', '\t', \ 
          'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', \ 
          'o', 'p', '[', ']', '\n', KBD_META_CTRL, 'a', 's', \ 
          'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', \ 
          '\'', '`', KBD_META_SHIFT, '\\', 'z', 'x', 'c', 'v', \ 
          'b', 'n', 'm', ',', '.', '/',KBD_META_SHIFT, '*', \ 
          KBD_META_LALT, ' ', KBD_META_CAPS, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, \ 
          KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KBD_META_NUM, KBD_META_SCRL, '7', \ 
          '8', '9', '-', '4', '5', '6', '+', '1', \ 
          '2', '3', '0', '.', 0, 0, 0, KEY_F11 , \ 
          KEY_F12, 0, 0, 0, 0, 0, 0, 0, \ 
          0, '\n', KBD_META_CTRL, '/', KEY_PRNT, KBD_META_RALT, 0, KEY_HOME, \ 
          KEY_UP, KEY_PGUP, KEY_LFT, KEY_RT, KEY_END, KEY_DN, KEY_PGDN, KEY_INS, \ 
          0, 0, 0, 0, 0, 0, 0, 0, \ 
          0, 0, 0, 0, 0, 0, 0, 0, \ 
         } 
+0

尋找關鍵地圖很容易,你只需去德國亞馬遜和尋找一個鍵盤出售,那麼你可以非常匹配到美國鍵盤。問題是,你如何表達他們。我的猜測是,您至少需要啓用unicode,並使您的軟件unicode。 – user3528438

+0

維基百科的圖片或Linux內核/ X11資源/ X11 kbd地圖 –

回答

0

possibly the sole place on the whole Internet were you'll find relevant information about this,你可以做兩件事情之一:

  • udev/X11的來源。顯然,Linux鍵盤驅動程序只是報告掃描碼,應用程序必須知道它的含義。

  • 這樣做udev/X11的源代碼,即連接您的WhateverLanguage鍵盤,並讓代碼在每次按下某個鍵時打印相應的掃描代碼。通過這種方式,您將知道掃描代碼映射到密鑰ß中,並且可以將其硬編碼到您的表格中。你只需要一點耐心;)。

+0

謝謝你,這是一種可能的方式。你能幫我在github的linux內核中找到udev目錄嗎?我感到很慚愧,但是我找不到它:( – student96

+0

@ student96:'udev'的代碼是[這裏是* systemd *](https:/ /cgit.freedesktop.org/systemd/systemd/tree/src/udev)。順便說一句,你通過第二種方式*更好,你需要解碼'systemd'二進制文件*等*來獲得udev的價值......無論如何,其他答案可能更適合你。 – 3442

0

我有另外一個建議:loadkeys -d --mktable輸出一個很好的翻譯表到Linux中的鍵碼。然後,dumpkeys -l顯示哪個鍵碼綁定到哪個keysym。另一種方法是運行showkey並按下其中一個感興趣的鍵(因此,顯然需要德語鍵盤)。

部分loadkeys -d --mktable我的系統(筆記本電腦標準的德國QWERTZ佈局)的輸出:

unsigned short plain_map[NR_KEYS] = { 
    0xf200, 0xf01b, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 
    0xf037, 0xf038, 0xf039, 0xf030, 0xf02d, 0xf03d, 0xf07f, 0xf009, 
    0xfb71, 0xfb77, 0xfb65, 0xfb72, 0xfb74, 0xfb79, 0xfb75, 0xfb69, 
    0xfb6f, 0xfb70, 0xf05b, 0xf05d, 0xf201, 0xf702, 0xfb61, 0xfb73, 
    0xfb64, 0xfb66, 0xfb67, 0xfb68, 0xfb6a, 0xfb6b, 0xfb6c, 0xf03b, 
    0xf027, 0xf060, 0xf700, 0xf05c, 0xfb7a, 0xfb78, 0xfb63, 0xfb76, 
    0xfb62, 0xfb6e, 0xfb6d, 0xf02c, 0xf02e, 0xf02f, 0xf700, 0xf30c, 
    0xf703, 0xf020, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 
    0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf208, 0xf209, 0xf307, 
    0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301, 
    0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf03c, 0xf10a, 
    0xf10b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf30e, 0xf702, 0xf30d, 0xf200, 0xf701, 0xf205, 0xf114, 0xf603, 
    0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, 
    0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf210, 0xf211, 0xf20e, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
}; 

static unsigned short shift_map[NR_KEYS] = { 
    0xf200, 0xf01b, 0xf021, 0xf040, 0xf023, 0xf024, 0xf025, 0xf05e, 
    0xf026, 0xf02a, 0xf028, 0xf029, 0xf05f, 0xf02b, 0xf07f, 0xf809, 
    0xfb51, 0xfb57, 0xfb45, 0xfb52, 0xfb54, 0xfb59, 0xfb55, 0xfb49, 
    0xfb4f, 0xfb50, 0xf07b, 0xf07d, 0xf201, 0xf702, 0xfb41, 0xfb53, 
    0xfb44, 0xfb46, 0xfb47, 0xfb48, 0xfb4a, 0xfb4b, 0xfb4c, 0xf03a, 
    0xf022, 0xf07e, 0xf700, 0xf07c, 0xfb5a, 0xfb58, 0xfb43, 0xfb56, 
    0xfb42, 0xfb4e, 0xfb4d, 0xf03c, 0xf03e, 0xf03f, 0xf700, 0xf30c, 
    0xf703, 0xf020, 0xf207, 0xf10c, 0xf10d, 0xf10e, 0xf10f, 0xf110, 
    0xf111, 0xf112, 0xf113, 0xf11e, 0xf11f, 0xf208, 0xf203, 0xf307, 
    0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301, 
    0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf03e, 0xf120, 
    0xf121, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf30e, 0xf702, 0xf30d, 0xf200, 0xf701, 0xf205, 0xf114, 0xf603, 
    0xf20b, 0xf601, 0xf602, 0xf117, 0xf600, 0xf20a, 0xf115, 0xf116, 
    0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf206, 0xf206, 0xf210, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
    0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 
}; 

如果你把一個值從那裏,例如plain_map[3]這是0xf032,並採取只有最低顯著字節,那麼你得到0x32,這,看着dumpkeys -l輸出(部分)...

0x0000 nul 
0x0001 Control_a 
0x0002 Control_b 
0x0003 Control_c 
0x0004 Control_d 
0x0005 Control_e 
0x0006 Control_f 
0x0007 Control_g 
0x0008 BackSpace 
0x0009 Tab 
0x000a Linefeed 
0x000b Control_k 
0x000c Control_l 
0x000d Control_m 
0x000e Control_n 
0x000f Control_o 
0x0010 Control_p 
0x0011 Control_q 
0x0012 Control_r 
0x0013 Control_s 
0x0014 Control_t 
0x0015 Control_u 
0x0016 Control_v 
0x0017 Control_w 
0x0018 Control_x 
0x0019 Control_y 
0x001a Control_z 
0x001b Escape 
0x001c Control_backslash 
0x001d Control_bracketright 
0x001e Control_asciicircum 
0x001f Control_underscore 
0x0020 space 
0x0021 exclam 
0x0022 quotedbl 
0x0023 numbersign 
0x0024 dollar 
0x0025 percent 
0x0026 ampersand 
0x0027 apostrophe 
0x0028 parenleft 
0x0029 parenright 
0x002a asterisk 
0x002b plus 
0x002c comma 
0x002d minus 
0x002e period 
0x002f slash 
0x0030 zero 
0x0031 one 
0x0032 two 
0x0033 three 
0x0034 four 
0x0035 five 
0x0036 six 
0x0037 seven 
0x0038 eight 
0x0039 nine 
0x003a colon 
0x003b semicolon 
0x003c less 
0x003d equal 
0x003e greater 
0x003f question 
0x0040 at 
0x0041 A 
0x0042 B 
0x0043 C 
0x0044 D 
0x0045 E 
0x0046 F 
0x0047 G 
0x0048 H 
0x0049 I 
0x004a J 
0x004b K 
0x004c L 
0x004d M 
0x004e N 
0x004f O 
0x0050 P 
0x0051 Q 
0x0052 R 
0x0053 S 
0x0054 T 
0x0055 U 
0x0056 V 
0x0057 W 
0x0058 X 
0x0059 Y 
0x005a Z 
0x005b bracketleft 
0x005c backslash 
0x005d bracketright 
0x005e asciicircum 
0x005f underscore 
0x0060 grave 
0x0061 a 
0x0062 b 
0x0063 c 
0x0064 d 
0x0065 e 
0x0066 f 
0x0067 g 
0x0068 h 
0x0069 i 
0x006a j 
0x006b k 
0x006c l 
0x006d m 
0x006e n 
0x006f o 
0x0070 p 
0x0071 q 
0x0072 r 
0x0073 s 
0x0074 t 
0x0075 u 
0x0076 v 
0x0077 w 
0x0078 x 
0x0079 y 
0x007a z 
0x007b braceleft 
0x007c bar 
0x007d braceright 
0x007e asciitilde 
0x007f Delete 
// ... 

...是鍵符two。運行showkey打印

keycode 3 press 
keycode 3 release 

這證實了這是怎麼回事還有我的(模糊)的理解時,按我的鍵盤上的兩個(非數字鍵盤)(:d)

我敢肯定,有一個小型的「翻譯程序「(你需要寫),使用上述信息,你可以得到你的映射。 (如果需要我可以提供完整的文件)

+0

你很快就能描述翻譯程序應該如何工作嗎? 我的理解是這樣的:當我按下一個鍵時,我檢查鍵碼,然後將其用於plain/shift數組的索引並獲取一個值,該值必須在dumpkey數組中找到。轉儲鍵數組是一個二維數組,所以我得到我要打印到控制檯的字符? – student96

相關問題