Results 1 to 1 of 1

Thread: Detecting Keymaps

  1. #1
    Join Date
    Apr 2009
    Beans
    252
    Distro
    Xubuntu 20.04 Focal Fossa

    Detecting Keymaps

    Is there a way of knowing what character a key will produce without actually pressing the key? I'm especially interested in combinations of keys that normally don't show up on the keyboard, such as pressing ALT-GR + a = æ.

    I've tried commands like 'dumpkeys' which will only say "Couldn't get a file descriptor referring to the console" and 'showkey' will only work in ascii mode, i.e. showkey -a, and its interactive, so will only show the code for a key that is pressed.

    Here's what I'm trying to do. I want a script to output the keyboard layout on the console, so I can see what is available to me without having to resort to "insert special character" type of programs.
    Code:
                      ALT-GR keyboard layout
    ┏━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┓
    ┃ \ ┃ | ┃ @ ┃ ~ ┃ ½ ┃ ½ ┃ ¬ ┃ { ┃ [ ┃ ] ┃ } ┃ \ ┃ ~ ┃
    ┗━━━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┓
          ┃ @ ┃ ł ┃ € ┃ ¶ ┃ ŧ ┃ ← ┃ ↓ ┃ → ┃ ø ┃ þ ┃ [ ┃ ] ┃
          ┗┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┓
           ┃ æ ┃ ß ┃ ð ┃ đ ┃ ŋ ┃ ħ ┃ j ┃ ĸ ┃ ł ┃ ~ ┃ { ┃ } ┃
        ┏━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻━━━┛
        ┃ | ┃ « ┃ » ┃ ¢ ┃ “ ┃ ” ┃ n ┃ µ ┃   ┃ · ┃ ̣  ┃
        ┗━━━┻━━━┻━━━┻━━━┻━━━┻━━━┻━━━┻━━━┻━━━┻━━━┻━━━┛
    
                  SHIFT-ALT-GR keyboard layout
    ┏━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┳━━━┓
    ┃ \ ┃ ¡ ┃ ⅛ ┃ £ ┃ $ ┃ ⅜ ┃ ⅝ ┃ ⅞ ┃ ™ ┃ ± ┃ ° ┃ ¿ ┃ ~ ┃
    ┗━━━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┳━┻━┓
          ┃ Ω ┃ Ł ┃ ¢ ┃ ® ┃ Ŧ ┃ ¥ ┃ ↑ ┃ ı ┃ Ø ┃ Þ ┃ ° ┃ ¯ ┃
          ┗┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┓
           ┃ Æ ┃ § ┃ Ð ┃ ª ┃ Ŋ ┃ Ħ ┃ J ┃ & ┃ Ł ┃ ˝ ┃ { ┃ ˘ ┃
        ┏━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻┳━━┻━━━┛
        ┃ ¦ ┃ < ┃ > ┃ © ┃ ‘ ┃ ’ ┃ N ┃ º ┃ × ┃ ÷ ┃ ˙ ┃
        ┗━━━┻━━━┻━━━┻━━━┻━━━┻━━━┻━━━┻━━━┻━━━┻━━━┻━━━┛
    These are dummies, of course. I'd like the script to be able to detect the keyboard and figure out what UTF-code each key generates when a modifier (ALT-GR or SHIFT ALT-GR) is used.
    Last edited by texpat; May 20th, 2012 at 11:22 PM. Reason: Added [code]-tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •