You are not logged in.
Peace all!
Is there a way to make the mode_switch key act as a toggle?
I found this from the a link in the emacs wiki.
http://www.tldp.org/HOWTO/Keyboard-and- … TO-15.html
"Can the Shift, Ctrl and Alt keys be made to behave as toggles?"
Yes, after saying
% loadkeys
keymaps 0-15
keycode 29 = Control_Lock
keycode 42 = Shift_Lock
keycode 56 = Alt_Lock
%
First of all, I can only run the program in console and not in X which is fine.
% loadkeys
keycode 108 = Control_Lock
(null):2: syntax error
syntax error in map file
key bindings not changed
I keep getting the above errors. Any loadkeys gurus out there?
Also, I read in the arch linux installation guide, it states that loadkeys only applies in console mode.
KEYMAP: Defines the keymap to load with the loadkeys program on bootup. Possible keymaps are found in /usr/share/kbd/keymaps. Please note that this setting is only valid for your TTYs, not any graphical window managers or X! Again, the default is fine for US users
Offline
Offline
You can call a script every time a key is pressed that does something based on its current state. A script like this will work. It simply creates or removes an empty file in the /tmp directory. If the file exists, then the key is in one state. If the file doesn't exist, it's in another. I just called the temp file mod_key_state for this example:
#!/bin/bash
if [ ! -f /tmp/mod_key_state ]
then
touch /tmp/mod_key_state
*** DO SOMETHING***
else
*** DO SMOTHING ELSE ***
rm /tmp/mod_key_state
fi
Offline
Doesn't that seem a little overkill?
The weird thing is the webby above seems to indicate an "inbuilt" functionality.
Offline
`man xmodmap` says that a list of keysym names can be found in keysymdef.h. `grep "_Lock" /usr/include/X11/keysymdef.h` returns only Shift_Lock of those used in your example, so that may be a problem.
Linux user #476135 || Dotfiles hosted by GitHub
Offline
If I understand your question correctly, what you want to use is ISO_Next_Group and ISO_Prev_Group.
A small example of how that would work with xmodmap
! remap caps_lock to do mode switching
remove Lock = Caps_Lock
keycode 66 = Mode_switch ISO_Next_Group Mode_switch ISO_Next_Group
! --- GROUP 1 ---- ---- GROUP 2 ----
keycode 43 = h H Left Home
keycode 44 = j J Down Next
keycode 45 = k K Up Prior
keycode 46 = l L Right End
This small snippet remaps the hjkl keys (on my keyboard at least. Check xev for the correct keycodes).
When you hold down the remapped Caps_Lock, you switch temporarily to the next group, allowing arrow movement on yout hjkl keys. If you press Shift+Caps_Lock (ISO_Next_Group), then you move to the next group, allowing access to the Group 2 keys without holding a modifier down. In that mode, shift would invoke Prior, Next, Home, End, and Shift+Caps_Lock would switch to the next group (Group 1). You can have more than 2 groups, and of course, you can bind your Mode_switch and ISO_* to whatever you like.
This will allow for a very complex and customized key layout, with many layers. If you are into power remapping, and like to learn a new layout, have a look at Neo, a subset of the de (german) layout. It is excellent to study to see what can be done with your keyboard.
Hope this helps.
.]
Offline
Thanks for the reply!
I've seen some of that and its especially useful for inputting multiple languages seamlessly. In my case, for a quick secondary modifier, the mode switch is enough. Only problem is I find myself continuously pressing my capslock(modeswitch) with my pinky throughout the use of "IJKL" arrow keys. Thought it might be useful to have it as a toggle instead.
Offline
Only problem is I find myself continuously pressing my capslock(modeswitch) with my pinky throughout the use of "IJKL" arrow keys. Thought it might be useful to have it as a toggle instead.
I thought the same originally. In the end I found that I need the switch too often to have it as a group switch. If the pinky bothers you, try using one of the Alt keys. If you have a keyboard with nice big Alt keys they are usually placed conveniently under the thumb. Then make the capslock a mod key, or control key (as it should be!). For inputting multiple languages I find myself liking Xcompose alot.
Offline