Recently it sprang to my mind that with SuSE 7.1 I used a utility called xkeycaps.
Unfortunately enough xkeycaps generates an .Xmodmap with keycodes expressed as hex numbers, while xev shows code as decimal numbers
This simple ruby oneliner converts an .Xmodmap file with hex codes to one with decimal codes
cat .Xmodmap.hex | ruby -n -e "if $_ =~ /keycode\s*(0x[A-F0-9][A-F0-9])\s*=\s*(.+?)\n/; puts \"keycode #{$1.hex} = #{$2} \" else puts $_ end"> .Xmodmap.decprovided you called the hex .Xmodmap '.Xmodmap.hex'.
No comments:
Post a Comment