alols / xcape

Linux utility to configure modifier keys to act as other keys when pressed and released on their own.
GNU General Public License v3.0
2.1k stars 117 forks source link

Stop space to ctrl #61

Closed ChillarAnand closed 8 years ago

ChillarAnand commented 8 years ago

As mentioned in readme I am using space as space and ctrl. How can I stop this behaviour?

vyp commented 8 years ago

Probably try setxkbmap and then killing all the xcape processes? (So if you have pgrep, pgrep xcape.)

ChillarAnand commented 8 years ago

Thanks for quick reply.

I ran

$ setxkbmap 
$ ps -ef | grep xcape
anand     5260  2417  0 13:41 ?        00:00:00 xcape -e Hyper_L space
$ kill -9 5260

Update:

Space is working as space but when i keep holding space it is not inserting multiple spaces.

vyp commented 8 years ago

Hmm, I guess I'm incorrect. (I didn't try it myself). Maybe see here: http://askubuntu.com/questions/29603/how-do-i-clear-xmodmap-settings ? Notice the comment that said setxkbmap -layout us worked for them (assuming you are using US keyboard layout).

Also, that is pretty weird that it's still working as space/ctrl though, because I'm pretty certain that killing the xcape process will end whatever xcape is doing. (Because see the readme, xcape has -d option, meaning by default, xcape forks into background, so killing the process should work I thought.) I guess I am wrong again... :/

Also, this probably doesn't matter, but trying doing it in reverse. i.e. Kill xcape process first, then run the appropriate setxkbmap command if you can figure that out (from the above link). (Because it's the reverse of what's in the readme.)

vyp commented 8 years ago

Also, I have to go now for a while, sorry. However, I guess I can't help you further anyway.

vyp commented 8 years ago

Also, assuming you are running these commands in your xinitrc or similar file, I suppose you could just restart your X session/computer? But I guess you are asking this for the reason that you cannot do this. Yeah xmodmap and setxkbmap are a pain to work with and they seem to have little to no documentation unfortunately... good luck!

ChillarAnand commented 8 years ago

I made a shell script x.sh for the steps mentioned in readme to convert space to space/ctrl.

When i accidentally run it 2nd time, it convert space to double space/ctrl.

To prevent this i am resetting kbd, killing xcape and then run x.sh.

Final script is here.

Thanks for the help.

lwilletts commented 8 years ago

I recommend using pkill $processName, much nicer syntax although might not ship with your distro by default.

roseperrone commented 6 years ago

@ChillarAnand could you fix the broken link to your script? I assume you simply prefixed the sequence of commands with setxkbmap us; pkill xscape?

ChillarAnand commented 6 years ago

@roseperrone Yes. Updated the link.