keymap customization

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
fenix

keymap customization

Post by fenix »

A bit of background:

Running Gloria, Xfce edition, the brand new shiny release; was running the RC before. I'm running into difficulties configuring my keyboard correctly and figured this was the best place to ask.

I have a (US) Mac keyboard, which I usually let the system approximate as type "105-key PC" though the key count is actually 109 and so this approximation fails to detect a few. Now, I'm dual-booting my system, Mac and Linux, and I'd like the key combos for basic functions (e. g. copy-paste) to be the same, so I want to swap the "Win" keys (Apple keys) with the Control keys, functionality-wise. (Don't see the point in having four Control keys, so I'd like to remap the default ones to something else.) Furthermore, I type in Spanish and German often enough that I want ready access to international characters, and I'd really like to use the Mac-style key combos for that because while the default configuration for PC105 works, it takes considerably more effort to type an ñ or anything with an umlaut than I like, and the Mac setup's a lot easier and doesn't require me to retrain myself. Finally, I want to change the function of the Capslock key to a second Escape.

Now, the problems:

First, obviously, the GUI tool is useless for most of this. It lets me pick PC105-US-Mac, but obviously doesn't include such finicky options as the position of the Control key. So I have to edit configuration files manually, or hack up a shell script to set the options I need -- no problem, right? Except I found two completely different configuration files governing my personal configuration alone, and editing them didn't seem to make any difference. Nor does xorg.conf any more, of course. Further, setxkbmap (combined with hacking up the Control-swapping in a file in /usr/share/X11/xkb/symbols/ so as to be able to set it) doesn't change anything, as shown:

Code: Select all

setxkbmap -v 10 -layout us
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Applied rules from evdev:
model:      pc105
layout:     us
options:    compose:menu,compose:ralt,numpad:mac,ctrl:mac_swap,capslock:escape,compose:menu,compose:ralt,numpad:mac,ctrl:mac_swap,capslock:escape,lv3:ralt_switch
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete+numpad(mac)
compat:     complete
symbols:    pc+us+inet(evdev)+level3(ralt_switch)+compose(ralt)+compose(menu)
geometry:   pc(pc105)
And then any hacks I had working appear to stop doing so, though they do that periodically for no good reason that I can see anyway so I'm not sure what the actual cause of the failure is. The best I can make out is that the "evdev" alluded to in this error message is something to do with hardware detection, but I haven't determined what I have to mess with to override it.

I also tried xmodmap (no apparent effect) and creating a new keymap (seemed to work at first, then broke everything, presumably because I did something weird with the formatting somewhere; I've since reinstalled the operating system.)

The keyboard configuration battle has been the last major problem in my Linux-on-Mac experience, and has been ongoing for a long time, so I'm really tired of this. I did have it working under Felicia, though!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Husse

Re: keymap customization

Post by Husse »

I agree that when you need to make more "advanced" changes to the keyboard layout it tends to be messy
Instead of xorg HAL is used, but from Karmic we have to rethink again as HAL will be deprecated in Karmic
If you know how you did it in xorg.conf this guide is helpful
fenix

Re: keymap customization

Post by fenix »

Now that was fun!

First I tried, referencing the page you linked, building a configuration file using "input.xkb.variant" et al., which seemed to fix the keymap problem -- it was correctly using the Mac settings for int'l characters -- but didn't apply the things I put in under "options" and, when I experimentally changed the "variant" value from "mac" to "dvorak", I realized that the file wasn't actually being read and the only reason anything had changed was that I had replugged the keyboard. So I changed the filename to "x11-input.fdi" on the theory that filename probably does matter, and changed to using the "input.x11_options.XkbVariant" format while I was at it -- still using the same options -- which resulted in my keyboard typing "/" once and failing to respond, my mouse being compromised (couldn't pull down menus, including by right-clicking) and functioning only slightly better when I unplugged the keyboard. I rebooted, managed to get into a shell, and deleted the file, then created a new one called "keymap.fdi" on the basis that configuring the keyboard alone was unlikely to mess up the mouse too. (I also opened a Thunar window as root in the right directory to be able to delete/move the file if necessary.) That screwed up the keyboard and mouse even worse, and I accidentally deleted the entirety of /etc/hal/fdi/policy instead of just the relevant .fdi file, which apparently meant that it had no idea what to do when I rebooted, because the configuration stayed royally screwed up despite the problem file being gone. So I booted in recover mode and reinstalled HAL, and here I am back where I started, with a Mac keyboard with Windows-style Ctrl and default Capslock behavior. It hasn't yet started doing the international characters wrong, but whether that's because it isn't going to (unlikely, as I haven't actually changed anything) or just because it hasn't gotten around to it yet I don't know. :? I guess I'll have to try again some other day when I'm in the mood for a good hard fight.
Husse

Re: keymap customization

Post by Husse »

I have not tried to use this, my keyboard is working as it should from the start with the exception of some multimedia key that I had to remap using the Keyboard shortcuts tool...
Locked

Return to “Xfce”