• The correspondance between the keycode and keysym given by `xev -event

    From hongyi.zhao@gmail.com@21:1/5 to All on Sat Aug 21 21:13:01 2021
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to hongy...@gmail.com on Sun Aug 22 12:19:19 2021
    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.

    HTH.

    Janis

    Regards, HY


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to hongy...@gmail.com on Sun Aug 22 11:47:10 2021
    In article <ad7376b2-8413-495e-9596-05a56dba584bn@googlegroups.com>, hongy...@gmail.com <hongyi.zhao@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:
    ...
    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.

    1) Whis is it a bad idea to not comply with Kenny's edict when responding
    to an HY post?

    Any hints for this question?

    2) What question?

    and

    3) Why do you care?

    --
    I voted for Trump because I thought he'd make pussy grabbing legal.
    I honestly don't see any other way America could be made great again.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lew Pitcher@21:1/5 to hongy...@gmail.com on Mon Aug 23 01:54:24 2021
    On Sun, 22 Aug 2021 18:29:13 -0700, hongy...@gmail.com wrote:

    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:

    $ 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.

    Got it. Thank you very much for your explanations.

    Best, HY

    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.

    HTH
    --
    Lew Pitcher
    "In Skills, We Trust"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hongyi.zhao@gmail.com@21:1/5 to Janis Papanagnou on Sun Aug 22 18:29:13 2021
    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:

    $ 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.

    Got it. Thank you very much for your explanations.

    Best, HY

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Lew Pitcher on Mon Aug 23 11:04:55 2021
    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.

    Though my comment was just meant to explain that there's a difference
    between key-codes and character encoding.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hongyi.zhao@gmail.com@21:1/5 to Janis Papanagnou on Mon Aug 23 18:10:37 2021
    On Monday, August 23, 2021 at 5:05:00 PM UTC+8, Janis Papanagnou wrote:
    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.

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to hongy...@gmail.com on Tue Aug 24 03:42:56 2021
    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:

    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.

    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


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hongyi.zhao@gmail.com@21:1/5 to Janis Papanagnou on Mon Aug 23 19:43:01 2021
    On Tuesday, August 24, 2021 at 9:43:00 AM UTC+8, Janis Papanagnou wrote:
    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:

    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.

    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)

    See the keymap rules used by me currently:

    werner@X10DAi-00:~$ setxkbmap -print
    xkb_keymap {
    xkb_keycodes { include "evdev+aliases(qwerty)" };
    xkb_types { include "complete" };
    xkb_compat { include "complete" };
    xkb_symbols { include "pc+us+us:2+inet(evdev)" };
    xkb_geometry { include "pc(pc105)" };
    };
    werner@X10DAi-00:~$ setxkbmap -query
    rules: evdev
    model: pc105
    layout: us,us
    variant: ,

    HY

    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


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)