PDA

View Full Version : Function keys (F1, F4) and a laptop...


melchior
01-27-2003, 11:06 PM
i use dvorak key layout on my ibook.

i need to be able to use the function keys in the xterm. i have a hack so that mac os x always using the f1 f2 f3 keys instead of volume and brightness.

these don't apply in x11. and the fn key that would normally make inpossible to use them doesn't function at all.

thanks

sao
01-28-2003, 01:38 AM
melchior,

Have you tried modifying your .Xmodmap file in your home directory?

If you have doubt as to the correct "keysym" word to use (slash for instance) try using 'xev'. The .Xmodmap file is not meant to be executable; it has a specific format. Man xev for more information.

If you want to list the current keymap table, issue the command:

xmodmap -pk | more

In recent OSX versions, doesn't depend on how long you press the Function key? For example, if I'm using windowmaker:

Short keypress -> F12, Wm menu
Long keypress -> eject CD


Maybe you can work with this file:

! this is a file for setting up Dvorak keyboard arrangement
! under X-Windows of unix OS.
! This file is prepared by Xah Lee (xah@xahlee.org)
! Xah's home page is "http://xahlee.org/";
!
! The content below the dashed line is obtained from
! http://www.mit.edu:8001/people/jcb/Dvorak/dvorak-keyboard.txt
! The above url is valid as of 2000/02.
!-----------------------------------
!
! ANSI Dvorak keyboard
!
! Author: Jeff Bigler (jcb@mit.edu)
! Last modified: 1996/08/27 13:45:30 by jcb@mit.edu
!
! This file should be given as an argument to xmodmap to
! switch from a qwerty to a Dvorak keyboard.
!
! If you want to be easily able to switch the keyboard
! back to its previous state, first run xmodmap -pke and
! redirect the output to a file. Then you can switch back
! by giving that file as an argument to xmodmap. For
! example, if you type:
!
! xmodmap -pke > /tmp/keyboard.default
!
! before switching the keyboard, you can then type:
!
! xmodmap /tmp/keyboard.default
!
! to reset the keyboard to its previous state.
!
! Note that if you pass this file again as an argument to
! xmodmap, you will apply these translations a second time
! and come out with gibberish!
!
keysym q = quoteright quotedbl
keysym w = comma less
keysym e = period greater
keysym r = p P
keysym t = y Y
keysym y = f F
keysym u = g G
keysym i = c C
keysym o = r R
keysym p = l L
keysym bracketleft = slash question
keysym bracketright = equal plus
keysym a = a A
keysym s = o O
keysym d = e E
keysym f = u U
keysym g = i I
keysym h = d D
keysym j = h H
keysym k = t T
keysym l = n N
keysym semicolon = s S
keysym quoteright = minus underscore
keysym z = semicolon colon
keysym x = q Q
keysym c = j J
keysym v = k K
keysym b = x X
keysym n = b B
keysym m = m M
keysym comma = w W
keysym period = v V
keysym slash = z Z
!
! The keysyms for the top row have been moved to the end
! of the file (and translations that would normally have
! no effect are still included) because of conflicts with
! some of the extended keysyms on HP workstations. If the
! keysyms for the 8 and 9 keys are not defined explicitly
! *after* the keysyms for bracketleft and bracketright,
! they end up getting bound to "slash question" and "equal
! plus", respectively.
!
keysym 1 = 1 exclam
keysym 2 = 2 at
keysym 3 = 3 numbersign
keysym 4 = 4 dollar
keysym 5 = 5 percent
keysym 6 = 6 asciicircum
keysym 7 = 7 ampersand
keysym 8 = 8 asterisk
keysym 9 = 9 parenleft
keysym 0 = 0 parenright
keysym minus = bracketleft braceleft
keysym equal = bracketright braceright

melchior
01-28-2003, 11:50 AM
argh! i'm so confused... none of it makes any sense!

i have tried modifying my keyboard layout and my .xmodmap but i can't get the keys i want functioning. note however that f7-f11 work the way they are supposed to.

i hope someone con figure this out, i have to believe there are other ibook and powerbook owners out there more savvy than i am that have solved this problem.

this is what i get after pressing f1 - f5 without the fn key pressed.

KeyPress event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 94865225, (609,320), root:(617,372),
state 0x0, keycode 130 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 characters: ""

KeyRelease event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 94865285, (609,320), root:(617,372),
state 0x0, keycode 130 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 characters: ""

KeyPress event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 94866395, (609,320), root:(617,372),
state 0x0, keycode 128 (keysym 0xffbf, F2), same_screen YES,
XLookupString gives 0 characters: ""

KeyRelease event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 94866474, (609,320), root:(617,372),
state 0x0, keycode 128 (keysym 0xffbf, F2), same_screen YES,
XLookupString gives 0 characters: ""

KeyPress event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 94867424, (609,320), root:(617,372),
state 0x0, keycode 105 (keysym 0xffc3, F6), same_screen YES,
XLookupString gives 0 characters: ""

KeyRelease event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 94867523, (609,320), root:(617,372),
state 0x0, keycode 105 (keysym 0xffc3, F6), same_screen YES,
XLookupString gives 0 characters: ""

KeyPress event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 94868434, (609,320), root:(617,372),
state 0x0, keycode 107 (keysym 0xffc0, F3), same_screen YES,
XLookupString gives 0 characters: ""

KeyRelease event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 94868533, (609,320), root:(617,372),
state 0x0, keycode 107 (keysym 0xffc0, F3), same_screen YES,
XLookupString gives 0 characters: ""

KeyPress event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 94869623, (609,320), root:(617,372),
state 0x0, keycode 126 (keysym 0xffc1, F4), same_screen YES,
XLookupString gives 0 characters: ""

KeyRelease event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 94869673, (609,320), root:(617,372),
state 0x0, keycode 126 (keysym 0xffc1, F4), same_screen YES,
XLookupString gives 0 characters: ""

melchior
01-28-2003, 11:53 AM
this is the same sequence with the 'fn' key depressed


KeyPress event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 95007724, (104,143), root:(112,195),
state 0x0, keycode 130 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 characters: ""

KeyRelease event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 95007793, (104,143), root:(112,195),
state 0x0, keycode 130 (keysym 0xffbe, F1), same_screen YES,
XLookupString gives 0 characters: ""

KeyPress event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 95008715, (104,143), root:(112,195),
state 0x0, keycode 128 (keysym 0xffbf, F2), same_screen YES,
XLookupString gives 0 characters: ""

KeyRelease event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 95008793, (104,143), root:(112,195),
state 0x0, keycode 128 (keysym 0xffbf, F2), same_screen YES,
XLookupString gives 0 characters: ""

KeyPress event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 95009824, (104,143), root:(112,195),
state 0x0, keycode 107 (keysym 0xffc0, F3), same_screen YES,
XLookupString gives 0 characters: ""

KeyRelease event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 95009943, (104,143), root:(112,195),
state 0x0, keycode 107 (keysym 0xffc0, F3), same_screen YES,
XLookupString gives 0 characters: ""

KeyPress event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 95010883, (104,143), root:(112,195),
state 0x0, keycode 126 (keysym 0xffc1, F4), same_screen YES,
XLookupString gives 0 characters: ""

KeyRelease event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 95010953, (104,143), root:(112,195),
state 0x0, keycode 126 (keysym 0xffc1, F4), same_screen YES,
XLookupString gives 0 characters: ""

KeyPress event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 95011913, (104,143), root:(112,195),
state 0x0, keycode 104 (keysym 0xffc2, F5), same_screen YES,
XLookupString gives 0 characters: ""

KeyRelease event, serial 22, synthetic NO, window 0x600001,
root 0x55, subw 0x0, time 95011982, (104,143), root:(112,195),
state 0x0, keycode 104 (keysym 0xffc2, F5), same_screen YES,
XLookupString gives 0 characters: ""



this is what i have in my ' xmodmap -pk | more'


101
102
103
104 0xffc2 (F5)
105 0xffc3 (F6)
106 0xffc4 (F7)
107 0xffc0 (F3)
108 0xffc5 (F8)
109 0xffc6 (F9)
110
111 0xffc8 (F11)
112
113 0xffca (F13)
114
115 0xffcb (F14)
116
117 0xffc7 (F10)
118
119 0xffc9 (F12)
120
121 0xffcc (F15)
122 0xff6a (Help)
123 0xff50 (Home)
124 0xff55 (Prior)
125 0xffff (Delete)
126 0xffc1 (F4)
127 0xff57 (End)
128 0xffbf (F2)
129 0xff56 (Next)
130 0xffbe (F1)
131 0xff51 (Left)
132 0xff53 (Right)
133 0xff54 (Down)
134 0xff52 (Up)