Sponsored Content
Operating Systems Linux Making CapsLock a Unique Modifier Post 302447574 by lawschool121 on Monday 23rd of August 2010 03:11:12 PM
Old 08-23-2010
Making CapsLock a Unique Modifier

I would like to use Caps Lock as its own UNIQUE modifier key (not merely replace it with Ctrl). I have figured out how to do this on windows but not yet in Ubuntu. Here is what I'm looking for:

1. When I press "Caps Lock" on its own, it is equivalent to the Escape key (or at least sends the "escape" command).
2. When I press Caps Lock + <new key>, it does other stuff.

I have figured out how to get EITHER ONE of these to work, but not both at the same time. For example, I have figured out how to turn Caps Lock into the unique "Super" modifier using xbindkeys and xmacro (this achieves #2). I have also figured out how to switch the escape and capslocks keys altogether to achieve #1. But I can't figure out how to get both outcomes at the same time!

Any advice?
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Getting back reference from s modifier

My input text has the following pattens: func_a(3, 4, 5); I want to replace it with this: func_b(3, 4, 5, 6); I'm trying the following expression, but it does not work: perl -p -e "s/func_a\((.*)?\);/func_b(\1,\n6)/s" <... (8 Replies)
Discussion started by: cooldude
8 Replies

2. UNIX for Dummies Questions & Answers

convert column into row with some modifier

A file content have 1 1:-0.289433 2:0.833778 3:0.314471 4:-0.289433 5:-0.81876 6:-0.456693 7:-0.17511 8:-0.644555 9:-0.00666341 10:-1.13603 I will like to have that column into row with numbers to be printed (red color) only after colon output shud be like that -0.289433... (1 Reply)
Discussion started by: cdfd123
1 Replies

3. Shell Programming and Scripting

get part of file with unique & non-unique string

I have an archive file that holds a batch of statements. I would like to be able to extract a certain statement based on the unique customer # (ie. 123456). The end for each statement is noted by "ENDSTM". I can find the line number for the beginning of the statement section with sed. ... (5 Replies)
Discussion started by: andrewsc
5 Replies

4. Solaris

Tar too large to archive. Use E function modifier.

hey all, i am trying to tar up a folder with sub folders the over all size will be about 70gb but when i use the normal command tar -cvf tar -cvf CLPSI_PRU_Escrow_31994.tar CLPSI_PRU_Escrow_31994 i get an error tar: CLPSI_PRU_Escrow_31994/dump1/PROD_SAE_jria3_dump.5 too large to archive. ... (9 Replies)
Discussion started by: dshakey
9 Replies

5. Shell Programming and Scripting

Change unique file names into new unique filenames

I have 84 files with the following names splitseqs.1, spliseqs.2 etc. and I want to change the .number to a unique filename. E.g. change splitseqs.1 into splitseqs.7114_1#24 and change spliseqs.2 into splitseqs.7067_2#4 So all the current file names are unique, so are the new file names.... (1 Reply)
Discussion started by: avonm
1 Replies

6. UNIX for Dummies Questions & Answers

Print unique lines without sort or unique

I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Discussion started by: cokedude
7 Replies

7. UNIX for Dummies Questions & Answers

Capslock and Python Question

Hello All, I was looking for a solution for enabling/disabling the Capslock from the command line and came across some Python code for doing just that... Well, in this case the code was written to ONLY turn-off Capslock but I assume there has to be a way to turn it on too. Site where I... (0 Replies)
Discussion started by: mrm5102
0 Replies
KEYMAPS(5)							File Formats Manual							KEYMAPS(5)

NAME
keymaps - keyboard table descriptions for loadkeys and dumpkeys DESCRIPTION
These files are used by loadkeys(1) to modify the translation tables used by the kernel keyboard driver and generated by dumpkeys(1) from those translation tables. The format of these files is vaguely similar to the one accepted by xmodmap(1). The file consists of charset or key or string definition lines interspersed with comments. Comments are introduced with ! or # characters and continue to the end of the line. Anything following one of these characters on that line is ignored. Note that comments need not begin from column one as with xmodmap(1). The syntax of keymap files is line oriented; a complete definition must fit on a single logical line. Logical lines can, however, be split into multiple physical lines by ending each subline with the backslash character (). INCLUDE FILES
A keymap can include other keymaps using the syntax include "pathname" CHARSET DEFINITIONS
A character set definition line is of the form: charset "iso-8859-x" It defines how following keysyms are to be interpreted. For example, in iso-8859-1 the symbol mu (or micro) has code 0265, while in iso-8859-7 the letter mu has code 0354. COMPLETE KEYCODE DEFINITIONS
Each complete key definition line is of the form: keycode keynumber = keysym keysym keysym... keynumber is the internal identification number of the key, roughly equivalent to the scan code of it. keynumber can be given in decimal, octal or hexadecimal notation. Octal is denoted by a leading zero and hexadecimal by the prefix 0x. Each of the keysyms represent keyboard actions, of which up to 256 can be bound to a single key. The actions available include outputting character codes or character sequences, switching consoles or keymaps, booting the machine etc. (The complete list can be obtained from dumpkeys(1) by saying dumpkeys -l .) Each keysym may be prefixed by a '+' (plus sign), in wich case this keysym is treated as a "letter" and therefore affected by the "Cap- sLock" the same way as by "Shift" (to be correct, the CapsLock inverts the Shift state). The ASCII letters ('a'-'z' and 'A'-'Z') are made CapsLock'able by default. If Shift+CapsLock should not produce a lower case symbol, put lines like keycode 30 = +a A in the map file. Which of the actions bound to a given key is taken when it is pressed depends on what modifiers are in effect at that moment. The keyboard driver supports 8 modifiers. These modifiers are labeled (completely arbitrarily) Shift, AltGr, Control, Alt, ShiftL, ShiftR, CtrlL and CtrlR. Each of these modifiers has an associated weight of power of two according to the following table: modifier weight Shift 1 AltGr 2 Control 4 Alt 8 ShiftL 16 ShiftR 32 CtrlL 64 CtrlR 128 The effective action of a key is found out by adding up the weights of all the modifiers in effect. By default, no modifiers are in effect, so action number zero, i.e. the one in the first column in a key definition line, is taken when the key is pressed or released. When e.g. Shift and Alt modifiers are in effect, action number nine (from the 10th column) is the effective one. Changing the state of what modifiers are in effect can be achieved by binding appropriate key actions to desired keys. For example, binding the symbol Shift to a key sets the Shift modifier in effect when that key is pressed and cancels the effect of that modifier when the key is released. Binding AltGr_Lock to a key sets AltGr in effect when the key is pressed and cancels the effect when the key is pressed again. (By default Shift, AltGr, Control and Alt are bound to the keys that bear a similar label; AltGr may denote the right Alt key.) Note that you should be very careful when binding the modifier keys, otherwise you can end up with an unusable keyboard mapping. If you for example define a key to have Control in its first column and leave the rest of the columns to be VoidSymbols, you're in trouble. This is because pressing the key puts Control modifier in effect and the following actions are looked up from the fifth column (see the table above). So, when you release the key, the action from the fifth column is taken. It has VoidSymbol in it, so nothing happens. This means that the Control modifier is still in effect, although you have released the key. Re-pressing and releasing the key has no effect. To avoid this, you should always define all the columns to have the same modifier symbol. There is a handy short-hand notation for this, see below. keysyms can be given in decimal, octal, hexadecimal, unicode or symbolic notation. The numeric notations use the same format as with keynumber. Unicode notation is "U+" followed by four hexadecimal digits. The symbolic notation resembles that used by xmodmap(1). Notable differences are the number symbols. The numeric symbols '0', ..., '9' of xmodmap(1) are replaced with the corresponding words 'zero', 'one', ... 'nine' to avoid confusion with the numeric notation. It should be noted that using numeric notation for the keysyms is highly unportable as the key action numbers may vary from one kernel ver- sion to another and the use of numeric notations is thus strongly discouraged. They are intended to be used only when you know there is a supported keyboard action in your kernel for which your current version of loadkeys(1) has no symbolic name. There is a number of short-hand notations to add readability and reduce typing work and the probability of typing-errors. First of all, you can give a map specification line, of the form keymaps 0-2,4-5,8,12 to indicate that the lines of the keymap will not specify all 256 columns, but only the indicated ones. (In the example: only the plain, Shift, AltGr, Control, Control+Shift, Alt and Control+Alt maps, that is, 7 columns instead of 256.) When no such line is given, the keymaps 0-M will be defined, where M+1 is the maximum number of entries found in any definition line. Next, you can leave off any trailing VoidSymbol entries from a key definition line. VoidSymbol denotes a keyboard action which produces no output and has no other effects either. For example, to define key number 30 to output 'a' unshifted, 'A' when pressed with Shift and do nothing when pressed with AltGr or other modifiers, you can write keycode 30 = a A instead of the more verbose keycode 30 = a A VoidSymbol VoidSymbol VoidSymbol VoidSymbol VoidSymbol ... For added convenience, you can usually get off with still more terse definitions. If you enter a key definition line with only and exactly one action code after the equals sign, it has a special meaning. If the code (numeric or symbolic) is not an ASCII letter, it means the code is implicitly replicated through all columns being defined. If, on the other hand, the action code is an ASCII character in the range 'a', ..., 'z' or 'A', ..., 'Z' in the ASCII collating sequence, the following definitions are made for the different modifier combinations, provided these are actually being defined. (The table lists the two possible cases: either the single action code is a lower case letter, denoted by 'x' or an upper case letter, denoted by 'Y'.) modifier symbol none x Y Shift X y AltGr x Y Shift+AltGr X y Control Control_x Control_y Shift+Control Control_x Control_y AltGr+Control Control_x Control_y Shift+AltGr+Control Control_x Control_y Alt Meta_x Meta_Y Shift+Alt Meta_X Meta_y AltGr+Alt Meta_x Meta_Y Shift+AltGr+Alt Meta_X Meta_y Control+Alt Meta_Control_x Meta_Control_y Shift+Control+Alt Meta_Control_x Meta_Control_y AltGr+Control+Alt Meta_Control_x Meta_Control_y Shift+AltGr+Control+Alt Meta_Control_x Meta_Control_y SINGLE MODIFIER DEFINITIONS
All the previous forms of key definition lines always define all the M+1 possible modifier combinations being defined, whether the line actually contains that many action codes or not. There is, however, a variation of the definition syntax for defining only single actions to a particular modifier combination of a key. This is especially useful, if you load a keymap which doesn't match your needs in only some modifier combinations, like AltGr+function keys. You can then make a small local file redefining only those modifier combinations and load- ing it after the main file. The syntax of this form is: { plain | <modifier sequence> } keycode keynumber = keysym , e.g., plain keycode 14 = BackSpace control alt keycode 83 = Boot alt keycode 105 = Decr_Console alt keycode 106 = Incr_Console Using "plain" will define only the base entry of a key (i.e. the one with no modifiers in effect) without affecting the bindings of other modifier combinations of that key. STRING DEFINITIONS
In addition to comments and key definition lines, a keymap can contain string definitions. These are used to define what each function key action code sends. The syntax of string definitions is: string keysym = "text" text can contain literal characters, octal character codes in the format of backslash followed by up to three octal digits, and the three escape sequences , \, and ", for newline, backslash and quote, respectively. COMPOSE DEFINITIONS
Then there may also be compose definitions. They have syntax compose 'char' 'char' to 'char' and describe how two bytes are combined to form a third one (when a dead accent or compose key is used). This is used to get accented let- ters and the like on a standard keyboard. ABBREVIATIONS
Various abbreviations can be used with kbd-0.96 and later. strings as usual Defines the usual values of the strings (but not the keys they are bound to). compose as usual for "iso-8859-1" Defines the usual compose combinations. To find out what keysyms there are available for use in keymaps, use the command dumpkeys --long-info Unfortunately, there is currently no description of what each symbol does. It has to be guessed from the name or figured out from the ker- nel sources. EXAMPLES
(Be careful to use a keymaps line, like the first line of `dumpkeys`, or "keymaps 0-15" or so.) The following entry exchanges the left Control key and the Caps Lock key on the keyboard: keycode 58 = Control keycode 29 = Caps_Lock Key number 58 is normally the Caps Lock key, and key number 29 is normally the Control key. The following entry sets the Shift and Caps Lock keys to behave more nicely, like in older typewriters. That is, pressing Caps Lock key once or more sets the keyboard in CapsLock state and pressing either of the Shift keys releases it. keycode 42 = Uncaps_Shift keycode 54 = Uncaps_Shift keycode 58 = Caps_On The following entry sets the layout of the edit pad in the enhanced keyboard to be more like that in the VT200 series terminals: keycode 102 = Insert keycode 104 = Remove keycode 107 = Prior shift keycode 107 = Scroll_Backward keycode 110 = Find keycode 111 = Select control alt keycode 111 = Boot control altgr keycode 111 = Boot Here's an example to bind the string "du df " to the key AltGr-D. We use the "spare" action code F100 not normally bound to any key. altgr keycode 32 = F100 string F100 = "du df " SEE ALSO
loadkeys(1), dumpkeys(1), showkey(1), xmodmap(1) 24 April 1998 KEYMAPS(5)
All times are GMT -4. The time now is 05:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy