I use the following command to check the keycode and keysym:
$ xev -event keyboard
For example, when I press the ``a'' key on the keyboard, the
following information will be returned:
KeyRelease event, serial 28, synthetic NO, window 0x1400001, root
0x1f6, subw 0x0, time 13267383, (-50,165), root:(72,279), state 0x10,
keycode 38 (keysym 0x61, a), same_screen YES, XLookupString gives 1
bytes: (61) "a" XFilterEvent returns: False
The corresponding info about this key is also represented in the
ASCII table as follows:
$ man 7 ascii |grep a$ 041 33 21 !
141 97 61 a
As you can see, the "keysym 0x61" is also shown in ASCII table, but I
still can't find the corresponding info of the "keycode 38", given by
`xev -event keyboard', from the ASCII table.
Any hints for this question?
Regards, HY
I use the following command to check the keycode and keysym:...
$ xev -event keyboard
For example, when I press the ``a'' key on the keyboard, the following >information will be returned:
As you can see, the "keysym 0x61" is also shown in ASCII table, but I
still can't find the corresponding info of the "keycode 38", given by `xev >-event keyboard', from the ASCII table.
Any hints for this question?
On Sunday, August 22, 2021 at 6:19:24 PM UTC+8, Janis Papanagnou wrote:
On 22.08.2021 06:13, hongy...@gmail.com wrote:
I use the following command to check the keycode and keysym:The ASCII table shows a table of characters and the position of these
$ xev -event keyboard
For example, when I press the ``a'' key on the keyboard, the
following information will be returned:
KeyRelease event, serial 28, synthetic NO, window 0x1400001, root
0x1f6, subw 0x0, time 13267383, (-50,165), root:(72,279), state 0x10,
keycode 38 (keysym 0x61, a), same_screen YES, XLookupString gives 1
bytes: (61) "a" XFilterEvent returns: False
The corresponding info about this key is also represented in the
ASCII table as follows:
$ man 7 ascii |grep a$ 041 33 21 !
141 97 61 a
As you can see, the "keysym 0x61" is also shown in ASCII table, but I
still can't find the corresponding info of the "keycode 38", given by
`xev -event keyboard', from the ASCII table.
Any hints for this question?
characters in the table defined by its numbers. (If you omit the grep
above you'd see that the character positions are just for convenience
shown in various bases.) It's an encoding schema for characters.
The keyboard has a set of keys that you can press. Every key-press will
create a code. These have nothing to do with how characters are encoded.
A key marked with '1' on the upper character row will have another code
than the key '1' on the number pad. It's an identification of the keys.
If you want a table of numbers what codes the keyboard keys have you'll
have to write that up for your keyboards, e.g. using something like xev.
This explanation is simplified, but it should serve to understand that
there is a difference between hardware keys (and their identification)
and the character encoding.
Got it. Thank you very much for your explanations.
Best, HY
On 22.08.2021 06:13, hongy...@gmail.com wrote:
I use the following command to check the keycode and keysym:
$ xev -event keyboard
For example, when I press the ``a'' key on the keyboard, the
following information will be returned:
KeyRelease event, serial 28, synthetic NO, window 0x1400001, root
0x1f6, subw 0x0, time 13267383, (-50,165), root:(72,279), state 0x10, keycode 38 (keysym 0x61, a), same_screen YES, XLookupString gives 1
bytes: (61) "a" XFilterEvent returns: False
The corresponding info about this key is also represented in the
ASCII table as follows:
$ man 7 ascii |grep a$ 041 33 21 !
141 97 61 a
As you can see, the "keysym 0x61" is also shown in ASCII table, but I
still can't find the corresponding info of the "keycode 38", given by
`xev -event keyboard', from the ASCII table.
Any hints for this question?The ASCII table shows a table of characters and the position of these characters in the table defined by its numbers. (If you omit the grep
above you'd see that the character positions are just for convenience
shown in various bases.) It's an encoding schema for characters.
The keyboard has a set of keys that you can press. Every key-press will create a code. These have nothing to do with how characters are encoded.
A key marked with '1' on the upper character row will have another code
than the key '1' on the number pad. It's an identification of the keys.
If you want a table of numbers what codes the keyboard keys have you'll
have to write that up for your keyboards, e.g. using something like xev.
This explanation is simplified, but it should serve to understand that
there is a difference between hardware keys (and their identification)
and the character encoding.
FWIW, you might want to take a look at the xmodmap(1) ("man 1 xmodmap") utility. This is the standard X utility for "modifying keymaps and pointer button mapping", and can be used to alter that table of Keynum vs Keysym
that Janis talked about.
On 23.08.2021 03:54, Lew Pitcher wrote:
FWIW, you might want to take a look at the xmodmap(1) ("man 1 xmodmap") utility. This is the standard X utility for "modifying keymaps and pointer button mapping", and can be used to alter that table of Keynum vs Keysym that Janis talked about.Besides xmodmap I'm also using xkbmap to fix things in my environment.
On Monday, August 23, 2021 at 5:05:00 PM UTC+8, Janis Papanagnou wrote:
On 23.08.2021 03:54, Lew Pitcher wrote:
Besides xmodmap I'm also using xkbmap to fix things in my environment.
FWIW, you might want to take a look at the xmodmap(1) ("man 1 xmodmap")
utility. This is the standard X utility for "modifying keymaps and pointer >>> button mapping", and can be used to alter that table of Keynum vs Keysym >>> that Janis talked about.
I can't find xkbmap on Ubuntu. Do you mean setxkbmap as shown below?
$ apt-file search -x xkbmap$
x11-xkb-utils: /usr/bin/setxkbmap
HY
On 24.08.2021 03:10, hongy...@gmail.com wrote:
On Monday, August 23, 2021 at 5:05:00 PM UTC+8, Janis Papanagnou wrote:
On 23.08.2021 03:54, Lew Pitcher wrote:
Besides xmodmap I'm also using xkbmap to fix things in my environment.
FWIW, you might want to take a look at the xmodmap(1) ("man 1 xmodmap") >>> utility. This is the standard X utility for "modifying keymaps and pointer
button mapping", and can be used to alter that table of Keynum vs Keysym >>> that Janis talked about.
I can't find xkbmap on Ubuntu. Do you mean setxkbmap as shown below?Correct, it is 'setxkbmap' and 'xkbcomp' that I use to operate two
different keyboards (US/104 and DE/105)
simultaneously on one system.
I also use 'xmodmap' to remap CapsLock. (I suppose I could also avoid
the latter command in favour of the former commands, but my trial and
error approach led me there and I was happy enough to get it working.)
Janis
$ apt-file search -x xkbmap$
x11-xkb-utils: /usr/bin/setxkbmap
HY
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 307 |
Nodes: | 16 (2 / 14) |
Uptime: | 96:52:38 |
Calls: | 6,850 |
Calls today: | 1 |
Files: | 12,352 |
Messages: | 5,414,948 |