geekhack

geekhack Community => Keyboards => Topic started by: Brodie337 on Sun, 13 June 2010, 20:25:22

Title: xmodmap
Post by: Brodie337 on Sun, 13 June 2010, 20:25:22
Hey, I'm hoping someone here might be able to help me.

I've managed to remap the caps loc to control in Ubuntu 10.04, but now I'm trying to remap the left control to be a Windows key. It's mapped as "Super_L" in Xmodmap, but when i try to assign it as a shortcut (For example, Super + Space to summon gnome-do), it wont work, but it does work on its own.

Any ideas?
Title: xmodmap
Post by: Harry_Y on Sun, 13 June 2010, 20:34:09
Have you tried setting it up in the "keyboard shortcuts"?

System > Preferences > Keyboard Shortcuts
Title: xmodmap
Post by: bigpook on Sun, 13 June 2010, 20:36:03
You could swap Caps and Cntrl in the keyboard options in gnome-control-center if you wanted straightaway.

Control_L is keycode 37

Super_L is keycode 133

So to make Cntrl_L act as the Win key put this in your xmodmap file.

keycode 37 = Super_L
Title: xmodmap
Post by: Brodie337 on Sun, 13 June 2010, 20:42:03
No luck... it works as super on its own, but as soon as I try to add another key, it stops sending anything at all. I don't think it is a blocking issue with the keyboard, because this applies to any key.
Title: xmodmap
Post by: Harry_Y on Sun, 13 June 2010, 20:49:52
Something here may help

http://linux-issues.blogspot.com/2008/01/mod4-key-in-fluxbox.html (http://linux-issues.blogspot.com/2008/01/mod4-key-in-fluxbox.html)
Title: xmodmap
Post by: Brodie337 on Sun, 13 June 2010, 20:53:53
The thing is though, the Windows key on my laptop works fine, just not on the GHSS that is attached to it.
Title: xmodmap
Post by: Harry_Y on Sun, 13 June 2010, 20:57:51
I also am using the GHSS

I never really have used the windows keys


What does the Win key do?
Title: xmodmap
Post by: Brodie337 on Sun, 13 June 2010, 21:04:35
Well, nothing really, but I use it alot in Compiz as a modifier. for example, to shift workspaces to the right, I usually use Control + Alt + Right. If I want to do the same, but take the window with me, I add Super to the command, stuff like that.

I can live without it, but it'll just take a little relearning.
Title: xmodmap
Post by: Harry_Y on Sun, 13 June 2010, 21:05:16
Thank you
Title: xmodmap
Post by: maetl on Sun, 13 June 2010, 21:55:39
You need to add:

clear mod4
add mod4 = Super_L

afterwards as well. Or at least I think that is the problem, at least if what you are doing expects a modifier key.
Title: xmodmap
Post by: Brodie337 on Sun, 13 June 2010, 21:58:15
To the end of the file I'm loading with .xmodmap?
Title: xmodmap
Post by: maetl on Sun, 13 June 2010, 22:00:19
Yes. Anytime after "keycode XXX = Super_L" should work.
Title: xmodmap
Post by: Brodie337 on Sun, 13 June 2010, 22:02:03
OK... there seems to be something wrong here...

Code: [Select]
[brodie::~]: xmodmap ~/.Xmodmap
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  118 (X_SetModifierMapping)
  Value in failed request:  0x17
  Serial number of failed request:  261
  Current serial number in output stream:  261

EDIT: The relevant bit of .Xmodmap
Code: [Select]
keycode  37 = Super_L
clear mod4
add mod4 = Super_L
Title: xmodmap
Post by: maetl on Sun, 13 June 2010, 22:04:56
It looks like a typo error. I don't know if it's mine or yours, but I think I've had that error several times before and that was the problem.
Title: xmodmap
Post by: Brodie337 on Sun, 13 June 2010, 22:54:44
OK... Fixed.

I changed the scancode for right windows in /usr/share/X11/xkb/keycodes/evdev to the scancode for control.