I was asked to help with a profile script to set xmodmaps and
redefine some keys on Sunray keyboards for an uttsc environment
(launched by the three-button salute dialog from a kiosk) to
match Windows keys in same locations.
The keyboard I was testing on is a (localized) Sun Type 7 keyboard,
so I detected the scan codes with xev and redefined:
* Alt Graph (ex-"Mode_switch") -> "Alt_R"
* Meta Right (ex-"Meta_R") -> "Multi_key" for Windows context menu
* Lat/Pyc (ex-"Multi_key") -> "Ctrl_R"
Basically, after some trial and error I added this to /etc/profile
stack along with other site-local overrides:
#########
### Turn some Sun Keyboard keys into Windows key functions on SunRays.
### Use "/usr/openwin/demo/xev" to find keycodes and "xmodmap" to set.
### Three keys right of the SPACEBAR:
### 237 "Alt Graph" = Mode_switch -> Alt
### 238 "Square" = Meta_R -> WinContext
### 108 "Lat/Pyc" = Multi_key -> Ctrl
"$XMODMAP" - << EOF
clear control
clear mod1
keycode 108 = Control_R
keycode 237 = Alt_R
keycode 238 = Multi_key
add control = Control_R
add control = Control_L
add mod1 = Alt_R
add mod1 = Alt_L
EOF
"$XMODMAP" -e "remove mod4 = Alt_R" 2>/dev/null
"$XMODMAP" -e "remove mod4 = Alt_L" 2>/dev/null
#########
Now there are questions :)
1) Does the solution above seem sane/correct?
2) Is there a way to detect that a Sun Type7 keyboard is currently
connected, as to not break key mappings of other keyboards, and/or
to enforce certain overrides for non-Sun kbds?
So far such precautions/selections are based on current DTU ID and
an administratively managed list of which DTUs have non-Sun kbds;
is anything fundamentally better possible?
3) So far tests in X11 succeeded (i.e. Ctrl_R+C and the Alt mapping
work for the terminal program), but the uttsc seems to keep on using
the old unsatisfactory mappings for the "Meta" and "Lat/Pyc" keys.
Does it use keyboard scan codes directly? Can that be remapped or
otherwise overridden?
Thanks,
//Jim Klimov
_______________________________________________
SunRay-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/sunray-users