Sponsored Content
Special Forums Hardware Keyboard layout based on scancodes? Post 302545851 by dotancohen on Tuesday 9th of August 2011 05:38:48 PM
Old 08-09-2011
Keyboard layout based on scancodes?

I would like to make a new keyboard layout that moves the modifier keys around. The problem is that this needs to be an xkb layout, because I still need to be able to switch to the Qwerty layout and the layout of my native language. Is there a way to write an xkb layout that works on the keycodes instead of the symbols?

That is, instead of this type of entry:
Code:
key <LCTL> { [ Control_L ] };

I would use this type of entry (doesn't work, just an example):
Code:
key keycode37 { [ Control_L ] };

I could then do something like put the Shift key where Alt was and move Alt to where the Windows key was:
Code:
key keycode133 { [ Alt_L ] };

Code:
key keycode64 { [ Shift_L ] };

If not, then could I write an additional symbols file and have X use that one when on the custom layout, and use the regular symbols file in the Qwerty and other layouts?

That would be more of a pain and less portable but I'm willing to try it if it's the only option. I've gone through the different layouts trying to understand just how the meta keys are defined and how to override them, but I can't figure it out. Also, I cannot find it documented anywhere. There exist tons of resources on making new keyboard layouts but nothing addresses the issue of moving the modifier keys around.

Thanks in advance for any help.
 

6 More Discussions You Might Find Interesting

1. SuSE

Keyboard Layout

ok, I am having a seriouse problem! I can not wite in my landguidge, I live in sweden but I seem to have an american keyboard layout so I cant write some letters and all the key commands are all messed up. Does anyone know where I can find a swedisch keyboard layout? (3 Replies)
Discussion started by: Kimm
3 Replies

2. UNIX for Dummies Questions & Answers

Changing Keyboard layout

Hi, How do i go about changing the keyboard layout to the UK layout. currently the @ symbol on the keyboard appears as a " sybol on the monitor. Many Thanks in advance Kam (1 Reply)
Discussion started by: vishnura
1 Replies

3. Linux

Changing default keyboard layout in Linux

Hi I have Fedora linux with XFCE desktop. I want to use Indic lanquage in that. I have installed unicode devnagri fonts. But I am not able to change my default keyboard layout. How can I change default keyboard layout in XFCE or through command line. Thanks NeeleshG (0 Replies)
Discussion started by: neel.gurjar
0 Replies

4. Solaris

Unable to change keyboard layout

After Solaris 10 installation I was unable to change keyboard using known commands kbd -s and eeprom keyboard layoit. Also modifinig /boot/solaris/bootenv.rc did not helped. And is possible to replace Solaris keymap with ubuntu keymap because my keyboard work perfectly under Ubuntu and... (7 Replies)
Discussion started by: microbot
7 Replies

5. Solaris

Unable to change keyboard layout

Hi to everyone Once again I tried to modify my keyboard , because I am crazy keyborad can not be changed using kbd-s eeprom also I tried to modify /boot/solaris/bootenv.rc but I tried opensolaris and my keyboard works perfectly So my question is Can I transfer settings from... (14 Replies)
Discussion started by: solaris_user
14 Replies

6. UNIX for Dummies Questions & Answers

Problem getting vertical bar with British keyboard layout on US (physical) keyboard

Hi, I've got a bit of a ridiculous problem and wasn't sure where to post it. I need to use the vertical bar for piping in Bash but, as per the title, am using a UK layout on a US (physical) keyboard which doesn't have a key for it in the place I'd expect. I've tried using xbindkeys and Unicode... (7 Replies)
Discussion started by: crunchgargoyle
7 Replies
SETXKBMAP(1)						      General Commands Manual						      SETXKBMAP(1)

NAME
setxkbmap - set the keyboard using the X Keyboard Extension SYNOPSIS
setxkbmap [ args ] [ layout [ variant [ option ... ] ] ] DESCRIPTION
The setxkbmap command maps the keyboard to use the layout determined by the options specified on the command line. An XKB keymap is constructed from a number of components which are compiled only as needed. The source for all of the components can be found in /usr/local/share/X11/xkb. OPTIONS
-help Prints a message describing the valid input to setxkbmap. -compat name Specifies the name of the compatibility map component used to construct a keyboard layout. -config file Specifies the name of an XKB configuration file which describes the keyboard to be used. -device device Specifies the numeric device id of the input device to be updated with the new keyboard layout. If not specified, the core keyboard device of the X server is updated. -display display Specifies the display to be updated with the new keyboard layout. -geometry name Specifies the name of the geometry component used to construct a keyboard layout. -I directory Adds a directory to the list of directories to be used to search for specified layout or rules files. -keycodes name Specifies the name of the keycodes component used to construct a keyboard layout. -keymap name Specifies the name of the keymap description used to construct a keyboard layout. -layout name Specifies the name of the layout used to determine the components which make up the keyboard description. Only one layout may be specified on the command line. -model name Specifies the name of the keyboard model used to determine the components which make up the keyboard description. Only one model may be specified on the command line. -option name Specifies the name of an option to determine the components which make up the keyboard description; multiple options may be speci- fied, one per -option flag. Note that setxkbmap adds options specified in the command line to the options that were set before (as saved in root window properties). If you want to replace all previously specified options, use the -option flag with an empty argu- ment first. -print With this option the setxkbmap just prints component names in a format acceptable by xkbcomp (an XKB keymap compiler) and exits. The option can be used for tests instead of a verbose option and in cases when one needs to run both the setxkbmap and the xkbcomp in chain (see below). -rules file Specifies the name of the rules file used to resolve the requested layout and model to a set of component names. -symbols name Specifies the name of the symbols component used to construct a keyboard layout. -synch Force synchronization for X requests. -types name Specifies the name of the types component used to construct a keyboard layout. -variant name Specifies which variant of the keyboard layout should be used to determine the components which make up the keyboard description. Only one variant may be specified on the command line. -verbose|-v [level] Specifies level of verbosity in output messages. Valid levels range from 0 (least verbose) to 10 (most verbose). The default ver- bosity level is 5. If no level is specified, each -v or -verbose flag raises the level by 1. USING WITH xkbcomp If you have an Xserver and a client shell running on different computers and XKB configuration files on those machines are different you can get problems specifying a keyboard map by model, layout, options names. This is because setxkbcomp converts these names to names of XKB configuration files according to files that are on the client side computer, then it sends the file names to the server where the xkb- comp has to compose a complete keyboard map using files which the server has. Thus if the sets of files differ significantly the names that the setxkbmap generates can be unacceptable on the server side. You can solve this problem by running the xkbcomp on the client side too. With the -print option setxkbmap just prints the file names in an appropriate format to its stdout and this output can be piped directly to the xkbcomp input. For example, the command setxkbmap us -print | xkbcomp - $DISPLAY makes both steps run on the same (client) machine and loads a keyboard map into the server. SEE ALSO
xkbcomp(1) FILES
/usr/local/share/X11/xkb X Version 11 setxkbmap 1.0.4 SETXKBMAP(1)
All times are GMT -4. The time now is 05:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy