开发者

How can I draw the current keyboard layout? [closed]

开发者 https://www.devze.com 2023-04-01 14:31 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I want to draw an ascii version of the current keyboard layout. Something like this, but with all keys:

  +---------------------------------------+
  | q | w | e | r | t | y | u | i | o | p |
  | a | s | d | f | g | h | j | k | l |   |
  | z | x | c | v | b | n | m |           |
  +---------------------------开发者_开发知识库------------+

Any idea on how to do that? If you know of an app like that, please let me know.

Thanks!


You should get the keyboard layout first and then based on the layout type print the keyboard. Think you should create a map of the layout types and the printing yourself.

Get keyboard: cat /etc/default/keyboard

Will echo the following and search for XKBLAYOUT.

# If you change any of the following variables and X is configured to
# use this file, then the changes will become visible to X only if udev
# is restarted.  You may need to reboot the system.

# The following variables describe your keyboard and can have the same
# values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options
# in /etc/X11/xorg.conf.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

# If you don't want to use the XKB layout on the console, you can
# specify an alternative keymap.  Make sure it will be accessible
# before /usr is mounted.
# KMAP=/etc/console-setup/defkeymap.kmap.gz
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号