You are not logged in.

#1 2011-08-26 18:48:12

Starfall
Member
From: /home/
Registered: 2011-05-24
Posts: 209
Website

[SOLVED] Apple Keyboard UK keymap

Hello smile

I use a UK Apple keyboard with my Arch box, I'd really appreciate it if someone'd point me in the right direction to get this set up properly!

Right now I can't type pound symbols, instead I get hash symbols, I should be able to type pound symbols with Shift+3 and then hash symbols with RightAlt+3

Thanks in advance!

Last edited by Starfall (2011-09-03 19:46:31)


Visit my blog and my DeviatArt page

Offline

#2 2011-08-26 19:29:35

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED] Apple Keyboard UK keymap

look up your kb map -- UK i think is "gb" or it might also be "uk", then put

setxkbmap gb &

in your xinitrc


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2011-08-26 20:18:25

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] Apple Keyboard UK keymap

If you set up X right, you have your keyboard layout configured in X. Check the wiki for pointers in case you did not.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#4 2011-08-26 22:01:38

Starfall
Member
From: /home/
Registered: 2011-05-24
Posts: 209
Website

Re: [SOLVED] Apple Keyboard UK keymap

Hmmm, I can now type pounds and hashes with my keyboard, as per Inxsible's advise, which I'm happy with, however a lot of the keys don't match up with what they're actually typing, is there not a specific keymap for a UK Apple keyboard? If not, this will suffice as is smile


Visit my blog and my DeviatArt page

Offline

#5 2011-08-27 20:23:22

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: [SOLVED] Apple Keyboard UK keymap

I have this to get everything working, the relevant part in my /etc/X11/xorg.conf.d/10-evdev.conf:

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
        Option "xkb_layout" "se"
        Option "XkbVariant" "nodeadkeys"
        Option "XkbOptions"    "apple:badmap"
EndSection 

This may interest you as well:
https://wiki.archlinux.org/index.php/Apple_Keyboard

Offline

#6 2011-08-31 18:34:49

Starfall
Member
From: /home/
Registered: 2011-05-24
Posts: 209
Website

Re: [SOLVED] Apple Keyboard UK keymap

Hmm, I've had no luck with getting any of the media keys to work sad Very frustrating having to pull the mixer up every time I want to adjust the volume.

Thanks for your post kaptenen, I have applied your config to my evdev conf, although this has given me the ability to type pound and hash symbols, unfortunately it seems it's mixed up a fair few other of my keys.

Appreciate the help with this guys smile

EDIT:

Thought it might be easier to help out if you guys could see my configs, perhaps something stupid I might've mucked up:

Here's my '10-evdev-conf' :

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
        Option "xkb_layout" "gb"
        Option "XkbVariant" "nodeadkeys"
        Option "XkbOptions"    "apple:badmap"
EndSection

Note: The line 'Option "xkb_layout" "gb" ' I have tried with 'gb' 'uk' and 'se'

Also, here's my output from '$ setxkbmap -print -verbose 10' :

Setting verbose level to 10
locale is C
Couldn't interpret _XKB_RULES_NAMES property
Use defaults: rules - 'base' model - 'pc105' layout - 'us'
Applied rules from base:
rules:      base
model:      pc105
layout:     us
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+inet(pc105)
geometry:   pc(pc105)
xkb_keymap {
	xkb_keycodes  { include "xfree86+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+inet(pc105)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

Interesting because it states my layout is 'us' ?

And finally here's my locale section from my rc.conf, just in case:

LOCALE="en_GB.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="UTC"
TIMEZONE="Europe/London"
KEYMAP="uk"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

Last edited by Starfall (2011-08-31 18:51:51)


Visit my blog and my DeviatArt page

Offline

#7 2011-08-31 18:47:39

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: [SOLVED] Apple Keyboard UK keymap

Hm, my .Xmodmap is like the one in the wiki, but i´m using this in awesome to make them work (you have to press fn, too):

    awful.key({}, "#122", volume_down_and_update),
    awful.key({}, "#123", volume_up_and_update),
    awful.key({}, "#121", volume_mute_and_update),
    awful.key({}, "#171", function () sexec("mpc next") end),
    awful.key({}, "#173", function () sexec("mpc prev")   end),
    awful.key({}, "#174", function () sexec("mpc stop") end),
    awful.key({}, "#172", function () sexec("mpc toggle")   end),
    awful.key({}, "#169", function () sexec("eject")   end), 

This may give you a hint. smile

Offline

#8 2011-08-31 19:06:29

Starfall
Member
From: /home/
Registered: 2011-05-24
Posts: 209
Website

Re: [SOLVED] Apple Keyboard UK keymap

Ah I see, after looking a bit more at Xmodmap, I think I get the idea, I think I'll be able to achieve my desired keyboard layout after playing a bit with that, provided everything goes well...

However I'm still not sure I'll be able to get the media keys to work, they seem to be using the below syndicate for the media keys:

'XF86AudioPlay', 'XF86AudioPrev', 'XF86AudioStop' ...etc

Is it using 'XF86' because of evdev? I'm pretty lost here as to how to assign those keys the function's I desire


Visit my blog and my DeviatArt page

Offline

#9 2011-08-31 20:07:03

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: [SOLVED] Apple Keyboard UK keymap

Hm, have you seen this? And maybe this?

Offline

#10 2011-08-31 20:54:32

Starfall
Member
From: /home/
Registered: 2011-05-24
Posts: 209
Website

Re: [SOLVED] Apple Keyboard UK keymap

So far so good kaptenen! I've been a bit of a tit and completely missed the fact that I actually have to load the xmodmap config with '$ xmodmap ~/.xmod'

And with one little test it's looking good! Thanks for the help, I'll mark this as solved provided I can manage to map the keys right big_smile

EDIT:

Okay, so I have all my keys setup perfect now using xmodmap, my keyboard now matches what is actually being typed! Woo!

However, still no luck with the media keys! sad

I even set 'F11', 'F12', etc to the primary 'XF86' media commands, however this doesn't seem to be working

Apologies, I know I'm being hassle, but I would genuinely deem this as an essential! Thanks very much for all the help so far smile

Last edited by Starfall (2011-08-31 21:55:36)


Visit my blog and my DeviatArt page

Offline

#11 2011-08-31 22:34:32

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: [SOLVED] Apple Keyboard UK keymap

Have you trying to do this as root: echo 2 > /sys/module/hid_apple/parameters/fnmode? Then you should make som magic with fn+F*, I guess!
Are you using some DE? Gnome or something?

Offline

#12 2011-08-31 23:17:38

Starfall
Member
From: /home/
Registered: 2011-05-24
Posts: 209
Website

Re: [SOLVED] Apple Keyboard UK keymap

Yup! I'm using XFCE (maybe I should have mentioned earlier, woops!)

I didn't perform the above command as I thought I'd wait for a reply to this now you know I'm running XFCE smile


Visit my blog and my DeviatArt page

Offline

#13 2011-09-01 00:10:04

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: [SOLVED] Apple Keyboard UK keymap

Oh, yeah run that command, then;
You should be running xfce-setting-show keyboard to set shortcuts.

Also, see this tread, it may help.

Offline

#14 2011-09-01 01:17:36

Deciare
Member
From: UTC -8:00
Registered: 2005-05-05
Posts: 79

Re: [SOLVED] Apple Keyboard UK keymap

Starfall wrote:

Here's my '10-evdev-conf' :

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
        Option "xkb_layout" "gb"
        Option "XkbVariant" "nodeadkeys"
        Option "XkbOptions"    "apple:badmap"
EndSection

Note: The line 'Option "xkb_layout" "gb" ' I have tried with 'gb' 'uk' and 'se'

Also, here's my output from '$ setxkbmap -print -verbose 10' :

[...]

Interesting because it states my layout is 'us' ?

Backing up a bit here, but try writing "XkbLayout" instead of "xkb_layout" in your config file above to set your layout.

Also, I have a U.S. Apple keyboard, so the following may not apply, but I don't need to do anything with xmodmap to get my media keys recognised. Have you tried running xev in a console window (without having run xmodmap) and then pressing your various media keys to confirm whether your media keys are already being recognised (as XF86AudioRaiseVolume, etc.)?

If they are recognised but pressing them doesn't appear to do anything, then you don't have any function associated with the keys. In Xfce4, you can open xfce4-keyboard-settings and then look under the Application Shortcuts tab to define additional keyboard shortcuts.

You could, for example, create a new shortcut for this command:

amixer set Master 5%+

and associate it with XF86AudioRaiseVolume to get your volume up key working.

Last edited by Deciare (2011-09-01 01:21:54)

Offline

#15 2011-09-01 11:56:10

Starfall
Member
From: /home/
Registered: 2011-05-24
Posts: 209
Website

Re: [SOLVED] Apple Keyboard UK keymap

Thanks again for all this help guys big_smile Really appreciate it.

I probably should have mentioned in my original post that I had tried setting the media keys in XFCE's keyboard settings, however there was no luck.

I think, possibly, from reading through that thread you posted kaptenen that I might just need to install 'volumed'.

Thanks for your post Deciare smile So far I'm happy with the result produced from Xmodmap, however if doing as you suggested will help with the media keys, I'll try it out.

So the verdict is, I'm currently at work... obviously working very hard wink But I'll install 'volumed' when I get home and see how that goes, if not I'll try as Deciare suggested.

Just in case it's relevant; I use pulseaudio with alsaplugins


Visit my blog and my DeviatArt page

Offline

#16 2011-09-01 16:28:02

Deciare
Member
From: UTC -8:00
Registered: 2005-05-05
Posts: 79

Re: [SOLVED] Apple Keyboard UK keymap

What I said about not needing xmodmap isn't mutually exclusive with kaptenen's advice... ^^; xmodmap's function in this case is to ensure that your media keys' keycodes are mapped to the appropriate keysyms (i.e. XF86AudioRaiseVolume, XF86AudioLowerVolume, etc.). However, if your keyboard is producing keycodes that map to the correct keysyms in the first place (as does mine), then you can skip the xmodmap step. That's all I was asking you to check with xev.

Offline

#17 2011-09-01 17:03:58

Starfall
Member
From: /home/
Registered: 2011-05-24
Posts: 209
Website

Re: [SOLVED] Apple Keyboard UK keymap

Deciare wrote:

What I said about not needing xmodmap isn't mutually exclusive with kaptenen's advice... ^^; xmodmap's function in this case is to ensure that your media keys' keycodes are mapped to the appropriate keysyms (i.e. XF86AudioRaiseVolume, XF86AudioLowerVolume, etc.). However, if your keyboard is producing keycodes that map to the correct keysyms in the first place (as does mine), then you can skip the xmodmap step. That's all I was asking you to check with xev.

Ah, I see! Well I can confirm that the correct keycodes are indeed mapped tot he correct keysyms, I noticed yesterday whilst looking through my xmod config.


Visit my blog and my DeviatArt page

Offline

#18 2011-09-03 19:46:16

Starfall
Member
From: /home/
Registered: 2011-05-24
Posts: 209
Website

Re: [SOLVED] Apple Keyboard UK keymap

Installation of 'xfce4-volumed' fixed the volume keys! Excellent!

The Play/Pause, Next & Previous keys I was able to map as their respected actions in Deadbeef, so, I'm all set!

Thanks for all the help guys! big_smile


Visit my blog and my DeviatArt page

Offline

Board footer

Powered by FluxBB