You are not logged in.

#1 2013-12-08 15:47:15

CoolArchBro
Member
Registered: 2013-12-08
Posts: 7

[SOLVED]A replacement for the autohotkey script

I just switched to Arch Linux and in windows I used Autohotkey to achieve the following

I replaced capslock with this>>>
press shift, wait for one other key to be pressed, release shift
(this makes is so that I can type capital letters by pressing caps one time and then pressing any letter)

When both shifts are pressed>>>
toggle capslock


I can remap keys without problems at the hardware level, because I use kinesis keyboard which has simple remapping functionality. But I do not know how to achieve in Arch what I have mentioned above. Can anybody point me in the right direction, please?

Last edited by CoolArchBro (2013-12-11 19:50:06)

Offline

#2 2013-12-08 21:43:30

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: [SOLVED]A replacement for the autohotkey script

Tough question. Can it be done with xmodmap somehow? This does something similar but not quite:

xmodmap -e "keycode 66 = Shift_Lock"

That makes caps a sticky shift key but you have to press shift to make it go away. Which makes it no improvement at all over the regular caps lock behaviour.

The only other thing that comes to mind is the compose key which does something similar (press the compose key then press two letters to get their combination, e.g. compose a e = æ). You'd have to define custom compose sequences for capital letters. So if your caps lock was the compose key and each single letter would be the sequence for a capital letter, the caps lock key may behave the way you want. I haven't tested that though. And it'd break the compose key for any other application if it did work.

Interesting problem. Good luck...

EDIT: maybe xkbset sticky -twokey is closer to home?

Last edited by frostschutz (2013-12-08 21:45:32)

Offline

#3 2013-12-08 21:51:19

mar04
Member
From: Poland
Registered: 2010-02-08
Posts: 117

Re: [SOLVED]A replacement for the autohotkey script

CoolArchBro wrote:

I replaced capslock with this>>>
press shift, wait for one other key to be pressed, release shift
(this makes is so that I can type capital letters by pressing caps one time and then pressing any letter)

I believe that's called "sticky keys" (but I'm not sure if I understood you correctly).
In terminal

xkbset sticky

If you're using Gnome/KDE you can find it in accessibility options.
There is a catch - it applies to all modifier keys, not only shift.
I think you could achieve exactly what you want using xmodmap.

CoolArchBro wrote:

When both shifts are pressed>>>
toggle capslock

In terminal

setxkbmap -option shift:both_capslock

For more options, take a look at setxkbmap and /usr/share/X11/xkb/rules/evdev.lst file in options section.
If you're using Gnome/KDE, those settings are somewhere in keyboard configuration pane of control center.

Warning: setxkbmap and xmodmap don't play well with each other.

EDIT: spelling

Last edited by mar04 (2013-12-12 09:44:18)

Offline

#4 2013-12-11 19:47:57

CoolArchBro
Member
Registered: 2013-12-08
Posts: 7

Re: [SOLVED]A replacement for the autohotkey script

I didn't even know that it is called sticky keys. Thanks for the help! I ended up just enabling sticky keys and remapping a few things (but in the keyboard itself, so I didn't get to use "setxkbmap")

"xkbset sticky" wasn't working well (it kept turning sticky keys off after a few moments), probably because I use xfce4. I ended up enabling sticky keys in the xfce4's settings (Settings -> Accessibility -> Keyboard -> "Use sticky keys" ) and it works great.

Offline

Board footer

Powered by FluxBB