Author Topic: xmodmap  (Read 2942 times)

0 Members and 1 Guest are viewing this topic.

Offline Brodie337

  • Thread Starter
  • Posts: 414
xmodmap
« 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?

Offline Harry_Y

  • Posts: 63
xmodmap
« Reply #1 on: Sun, 13 June 2010, 20:34:09 »
Have you tried setting it up in the "keyboard shortcuts"?

System > Preferences > Keyboard Shortcuts

Offline bigpook

  • Posts: 1723
xmodmap
« Reply #2 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
« Last Edit: Sun, 13 June 2010, 20:39:03 by bigpook »
HHKB Pro 2 : Unicomp Spacesaver : IBM Model M : DasIII    

Offline Brodie337

  • Thread Starter
  • Posts: 414
xmodmap
« Reply #3 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.

Offline Harry_Y

  • Posts: 63
xmodmap
« Reply #4 on: Sun, 13 June 2010, 20:49:52 »

Offline Brodie337

  • Thread Starter
  • Posts: 414
xmodmap
« Reply #5 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.

Offline Harry_Y

  • Posts: 63
xmodmap
« Reply #6 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?

Offline Brodie337

  • Thread Starter
  • Posts: 414
xmodmap
« Reply #7 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.

Offline Harry_Y

  • Posts: 63
xmodmap
« Reply #8 on: Sun, 13 June 2010, 21:05:16 »
Thank you

Offline maetl

  • Posts: 11
xmodmap
« Reply #9 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.

Offline Brodie337

  • Thread Starter
  • Posts: 414
xmodmap
« Reply #10 on: Sun, 13 June 2010, 21:58:15 »
To the end of the file I'm loading with .xmodmap?

Offline maetl

  • Posts: 11
xmodmap
« Reply #11 on: Sun, 13 June 2010, 22:00:19 »
Yes. Anytime after "keycode XXX = Super_L" should work.

Offline Brodie337

  • Thread Starter
  • Posts: 414
xmodmap
« Reply #12 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
« Last Edit: Sun, 13 June 2010, 22:05:27 by Brodie337 »

Offline maetl

  • Posts: 11
xmodmap
« Reply #13 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.

Offline Brodie337

  • Thread Starter
  • Posts: 414
xmodmap
« Reply #14 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.