Determining scancodes for obscure keyboard to modify keymap

Polytropon freebsd at edvax.de
Tue Feb 24 15:22:31 PST 2009


On Tue, 24 Feb 2009 14:28:54 -0700, carnage <carnagewashere at gmail.com> wrote:
> I am looking to remap an apple usb keyboard (a1048).  It has F13-16, 3
> volume control keys and an eject key but no scroll lock, num lock,
> pause/break, etc.  I'm wondering how I would go about changing some of these
> not so useful keys into useful keys.

I have the same keyboard on a secondary system and would know the
answert to your question, too. :-)

As I knew from configuring my Sun USB Type 6 keyboard, xev is a good
tool to check the keyboard output. It works for the Apple keys next
to the space bar, but not for PF13 -- PR16, the volume keys and the
eject key - xev doesn't show anything when they're pressed.

Maybe you can use my ~/.xmodmaprc for the Sun keyboard, at least for
educational purposes. :-)

(I'll add the english key names; because I have the german version,
I've initially named *them* within the comments.)


! ------------------------------------------------------------------------
! $XFree86: xc/programs/Xserver/hw/xfree86/etc/xmodmap.std,v 3.5 1996/12/23 06:47:28 dawes Exp $
! $XConsortium: xmodmap.std /main/7 1996/02/21 17:48:55 kaleb $

!clear mod3
!clear mod4

add mod4 = Multi_key

! Hilfe / Help
keycode 144 = F13
! Stop / Stop
keycode 145 = F14
! Wiederholen / Again
keycode 146 = F15
! Eigenschaften / Props
keycode 147 = F16
! Zurücknehmen / Undo
keycode 148 = F17
! Vordergrund / Front
keycode 149 = F18
! Kopieren / Copy
keycode 150 = F19
! Öffnen / Open
keycode 151 = F20
! Einsetzen / Insert
keycode 152 = F21
! Suchen / Find
keycode 153 = F22
! Ausschneiden / Cut
keycode 154 = F23


! Ton aus / Entmagnetisieren / Mute / Degauss
keycode 141 = F24
! Leiser / Mehr Kontrast / Lower volume / contrast
keycode 142 = F25
! Lauter / Weniger Kontrast / Raise volume / contrast
keycode 143 = F26
! Ausschalten (Mond) / Switch off (Moon)
keycode 140 = F27


! Meta links / Meta left
keycode 115 = Meta_L
! Meta rechts / Meta right
keycode 116 = Meta_R
! Compose
keycode 117 = Multi_key
! ------------------------------------------------------------------------

It's easy to find out what the keys send using xev. Then, you can
easily assign any key name to them that is present in the symbol
file for xkb stuff. Note that this worked with XFree86 and X.org
so far, but due to the newest "improvements", it may be possible
that settings have to be done very differently now... (I've not
taken the update yet.)



If you got the keys working, please report back to the list. I'd
be very interested in using them. They work fine when the keyboard
is attached to an iBook.



-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list