How to make modifier keys lockable? (like Caps Lock for Ctrl or Alt)

Playing around with the non-modal text editor ne, I found myself wondering if one could simulate a modal interface (like vim has) by having something like "Ctrl Lock" or "Alt Lock" (analogous to Caps Lock) and thus a "ctrl mode"/"alt mode". I would like to try this, but I am not sure how to make it happen.
My best guess is that this could be accomplished via XKB, but its documentation looks pretty intimidating. Is anyone here proficient in XKB and could point me in the right direction?
Other ideas:
– Is this something that a terminal emulator could do? Is there already one that can do it?
– Or a shell?
– For console applications, would it be possible to have a small wrapper that did nothing but intercept keyboard input and just pass everything through to the wrapped process, except that it would take into account the desired lockable modifier key? (I am thinking of tput here, but from my first search it appears that it doesn't do this sort of thing.)

@Trilby: Thank you for the elaborate input!
@drcouzelis: "sticky keys" normally means that modifiers remain active only until the next keypress, while I want a way to lock them in active state for an arbitrary number of keypresses. But still, "sticky keys" was a worthwile input for the search engine.
The program xkbset, which can be used to set XKB options on the fly, has a function that comes very close to what I desire:
$ xkbset h
Usage: To set or unset various options:
xkbset <options>
where <options> may be all or any of (the '-' switches the feature off,
otherwise it is switched on):
To switch sticky keys on or off, and optionally set or reset:
() two keys pressed at the same time stops sticky keys;
() a modifier pressed twice will be locked:
[-]{sticky|st} [[-]twokey|[-]latchlock]...
I cannot select specific modiers to be affected with xkbset, but that would be fine with me. Sadly, it didn't completely work for me:
– It doesn't affect Alt at all for me.
– The effect seems to go away as soon as I change the window. (Maybe I need to invoke xkbset from .xinitrc for its effects to persist throughout the session? I will try that.)
So I went on and tried to configure XKB manually. I got up to a certain point without studying the documentation in-depth, but now I have landed on an error message that seems to suggest to me that I would have to get to a better understanding about the layout files before I could understand it. Here is what I did:
1. Got my current XKB configuration:
xkbcomp :0 output.xkb
2. Editet output.xkb to include the following at the end of the xkb_compatibility section:
//Hoping this makes the ^-key into a Ctrl-Lock key:
interpret TLDE {
action= LockMods(modifiers=Control);
3. Then I recompiled the configuration back into the running X server:
$ xkbcomp out.xkb :0
Warning: Compat map for group 2 redefined
Using new definition
Warning: Compat map for group 3 redefined
Using new definition
Warning: Compat map for group 4 redefined
Using new definition
Error: Couldn't lookup keysym
Symbol interpretation ignored
Warning: No symbols defined for <AB11> (keycode 97)
Warning: No symbols defined for <JPCM> (keycode 103)
Warning: No symbols defined for <I120> (keycode 120)
Warning: No symbols defined for <AE13> (keycode 132)
Warning: No symbols defined for <I149> (keycode 149)
Warning: No symbols defined for <I154> (keycode 154)
Warning: No symbols defined for <I168> (keycode 168)
Warning: No symbols defined for <I178> (keycode 178)
Warning: No symbols defined for <I183> (keycode 183)
Warning: No symbols defined for <I184> (keycode 184)
Warning: No symbols defined for <FK19> (keycode 197)
Warning: No symbols defined for <FK24> (keycode 202)
Warning: No symbols defined for <I217> (keycode 217)
Warning: No symbols defined for <I219> (keycode 219)
Warning: No symbols defined for <I221> (keycode 221)
Warning: No symbols defined for <I222> (keycode 222)
Warning: No symbols defined for <I230> (keycode 230)
Warning: No symbols defined for <I247> (keycode 247)
Warning: No symbols defined for <I248> (keycode 248)
Warning: No symbols defined for <I249> (keycode 249)
Warning: No symbols defined for <I250> (keycode 250)
Warning: No symbols defined for <I251> (keycode 251)
Warning: No symbols defined for <I252> (keycode 252)
Warning: No symbols defined for <I253> (keycode 253)
The "Error" part is where I am currently stuck. It tells me that my changes were ignored (I no that it's about them because it goes away when I comment them out), but I don't yet understand why.

Similar Messages

  • How to make a rubber effect like when you swipe between apps using 4 fingers on iPad ?

    Hey guys,
    So how to make a rubber effect like when you swipe between apps (first or last app) using 4 fingers on iPad iOS7 ? Any examples ?
    Thanks!
    Ivan

    Please do not double post the same question.
    Just like I said before. Animate X scale and position. Set the anchor point of the left image to the left side. You can then use an expression or just generate keyframes for scale. When you flip to the next screen then animate position. Easy basic animation except for the bounce. Key framing the bounce so that it looks natural takes a lot of experience or an expression.
    Google bounce expression after effects and find this. http://www.motion-graphics-exchange.com/after-effects/Wiggle-rubber-bounce-throw-inertia-e xpressions/4ad0f32a944ad
    There are a bunch of other solutions.
    There is no single click solution to this problem and it is not an effect, it is an animation.

  • How to make a key out of this data?

    Since no one replied to my last post, I'll give it another try. From an RTSP server I get two values, a key called rsaaeskey (342 bytes, without the line breaks):
      yxKBocBgTii20n9nbKfYGyGhPqtosXuq8M99yU5/PzTVNmIUsUGlpD27u
      cqN8eNFvmaO7cFVXeaMGaCfI5V+YNrd77xGQ+CUE0XFraXUvp4cF4aX1L
      ZOGe38nwX3Ba+4bQFfjmYgz3ObRuOWlw9KCi4CMP5574F+CIvutVAwtAC
      PiDFF7nVcoaBTr2QbSUile0Zs3Hyxjn9PWVaey9Nu2DgJZ8rtw6F2SkQ7
      NDHBjjUKXNIeCAeBFuV4XNiazvi3gWa4VbgITtD9jcm+7nPMAK0oBL1S3
      K3Z6FK7XVnfehYYJjRw7THMZzSvq7FtLB9QgulqQTJ3awJdwS0ACb1FkAand an initialization vector called aesiv (22 bytes):
      zcZmAZtqh7uGcEwPXk0QeAThe data is obviously Base64 encoded. However, after decoding I don't know how to make a key out of it. Trying KeyFactory's generatePublic and generatePrivate methods result in an InvalidKeySpecException with any algorithm I've tried (RSA, DSA, DH).
    I think this is a multi-prime RAS secret key (someone said they're 342 bytes long), but how do I generate a Java Key out of it?

    The rsaaeskey, decoded to binary, is a binary array of 256 bytes. Using the DUMPASN1 tool we see that the bytes are not in ASN.1 BER or DER encoding.
    C> openssl enc -base64 -d -in rsaaeskey.base64 -out test.bin
    C> dumpasn1 rsaaeskey.bin
       0 CB   18: [PRIVATE 11]
                :   81 A1 C0 60 4E 28 B6 D2 7F 67 6C A7 D8 1B 21 A1
                :   3E ABIf it were encoded in ASN.1 BER or DER encoding it will start as a "SEQUENCE" or a "SET", not as an unrecognized data.
    You need to check the exact specification of the protocol. (Are you using TSP - RFC 3161, or RTSP - RFC 2326?)

  • How to make ENTER key in internet explorer run the  BIP report?

    In BI publisher 11g, users wanted that after entering the values for the parameter, they hit the ENTER key ( on the keyboard)  and the report should run .
    In Mozilla firefox, when I hit ENTER key on the keyboard report runs fine... but in Internet explorer, it does not ( infact in internet explorer TAB key works)
    How to make ENTER key in internet explorer run the report?
    Thanks
    Ashish

    Perform the following steps and tell us if it  resolve this issue:
    1. In Internet Explorer, click Tools, and then click Internet Options.
    2. Click the Security tab.
    3. There are four security zones listed:
    * Internet
    * Local intranet
    * Trusted sites
    * Restricted sites
    Click the zone being used by P6, which is noted at the bottom right hand corner of the browser window when the P6 URL is being accessed.
    4. Under Security level for this zone, click Custom Level.
    5. Under Downloads, under Automatic prompting for file downloads, click Enable, and then click OK two times.
    6. The browser will need to be restarted for the change to take effect.
    Refer to the following Microsoft Knowledge base article for additional file download and active x controls which should also be enabled: http://support.microsoft.com/kb/883255

  • I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini. don't need the caps/lock or ctrl key and due to an injury my daughter can only use her left hand to type. She is using a text to speech app to verbaliz

    I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini. I don't need the caps/lock or ctrl key. Due to a brain injury my daughter can only use her left hand to type. She also uses a text to speech app to verbalize all of her needs since her speech isn't intelligible any longer either. And her vision was significantly affected also, so the keyboard has to be mounted about 6 inches from her face. So to reach across the keyboard with her left hand to the right side delete and enter button is physically difficult and causes typing errors, which cause people to not understand what shes trying to say.
    The best keyboard so far is the Zagg folio mini. I just had to make stickers to enlarge the letters on the key buttons.
    Does anyone know how I can reprogram these two keys? Or where I can buy a wireless mini keyboard for Ipad made for lefthanders with these two functions on the left side. I have searched for days and days. It's sooooo important to me that she be able to contribute her voice again. Imagine if you got in a car accident and couldn't speak clearly any longer, but understood everything still. Thanks for any help and suggestions you all take the time to share with me. I really appreciate the kindness of strangers to help me help my daughter.
    Sami's mom

    Sami\'s mom wrote:
    I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini.
    You cannot.

  • How do you modify the web.xml to lock down the pages from a user role

    how do you modify the web.xml to lock down the pages from a user role

    I'll make a stab at your question:
    The following is an example of where a URL is protected within a web.xml deployment descriptor. In this example, the URL /protectedA within the application is protected:
    <!-- security constraints -->
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>protectedA</web-resource-name>
    <url-pattern>/protectedA</url-pattern>
    </web-resource-collection>
    <!-- authorization -->
    <auth-constraint>
    <role-name>sr_developer</role-name>
    </auth-constraint>
    </security-constraint>
    Sun's explaination here:
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Security4.html

  • Its not a question, but i just hope someone from apple can read this, i just wish you can make a card just like itunes card, for ipad wi-fi card. would be convenience.

    its not a question, but i just hope someone from apple can read this, i just wish you can make a card just like itunes card, for ipad wi-fi card. would be convenience.

    That's why he gave you the link to make the suggestion.
    But returning to your proposal ... Apple does not sell any of the "wifi" connections. It would be up to providers of service to sell giftcards, and perhaps Boingo or some of other airport-commercial WiFi firms do. I can't think of any other place I've been asked to pay for WiFi.
    Now Verizon and AT&T, as well as other providers in other countries, could sell Gift Cards... and again, perhaps they do, but you'll have to check with them or make the suggestions there. It's really not an Apple issue, as they don't sell or provide any connections, just the hardware to make them.

  • How to make intellisense enable in powershell in CSOM for sharepoint online?

    how to make intellisense enable in powershell in CSOM for sharepoint online?
    I am loading assembly  as following
    [Reflection.Assembly]::LoadFrom("$scriptdir\Microsoft.SharePoint.Client.dll")        
     [Reflection.Assembly]::LoadFrom("$scriptdir\Microsoft.SharePoint.Client.Runtime.dll")

    Hi,
    try this
    http://powerguivsx.codeplex.com/
    http://mackenzie-sharepoint.blogspot.com/2011/12/sharepoint-2010-powershell-intellisense.html
    https://technet.microsoft.com/en-us/library/ff461033.aspx
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/fcb85984-abf9-428a-a2a7-952cec37ea49/powershell-ise-intellisense
    Kind Regards,
    John Naguib
    Senior Consultant
    John Naguib Blog
    John Naguib Twitter
    Please remember to mark this as answered if it helped you

  • How to transfer license key from Windows to Mac for adobe photoshop lightroom 5?

    how to transfer license key from Windows to Mac for adobe photoshop lightroom 5?

    You can download from this link and validate with your serial number. You can run LR5 on both machines.
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5856

  • Kdemod4, no way to change caps lock to ctrl?

    I usually change caps lock to ctrl.
    I'm new to KDE (using 4.3 with kdemod), and don't see the option to change the key in the keyboard system settings.
    Am I just being blind, or do I have to use something else like xmodmap?

    I believe you can do this in the xorg config file.
    Take a look at /usr/share/X11/xkb/rules/xorg.lst.  When I had an Apple computer, I mapped the Apple key to cntl by remapping it:
    Section "InputDevice"
    Option "XkbOptions" "altwin:ctrl
    EndSection
    Think it can be done with caps lock, but not entirely sure.  Caps lock behaves a little different than other keys though.
    Last edited by Gen2ly (2009-09-21 11:25:05)

  • Remap caps lock to Ctrl in console (tty)

    I tried to use loadkeys to remap caps lock to Ctrl and Ctrl to caps lock but it doesn't work, because i think use caps lock is easier than press Ctrl when i move around keyboard. so i wonder:
    1. how can i remap caps lock to Ctrl and Ctrl to caps lock in bash (in tty)
    2. how can i remap caps lock to ESC in vim (in tty)
    I tried to modify /usr/local/share/kbd/keymaps/personal.map
    keycode 58 = 29
    keycode 29 = 58
    58 is caps lock keycode
    29 is control keycode.
    Thanks in advanced!

    yep, tks a lot, english is not my native language.
    write a super short script that simply changes keymap before calling vim.
    you mean i need to reload keymap when i call vim. if that i need to modify my .vimrc to call a script to reload the keymap. humm, that's problem, how can i call a script in .vimrc?  i am new to linux so can you show me howto?

  • How do i know if my iphone is locked for backup

    How can I tell if my iphone is locked for the purposes of doing an icloud backup? If it's locked, how would I get to the settings icon?

    For doing an iCloud backup, it does not matter if your iPhone is locked or not.  The iCloud backup will occur if your iPhone is plugged in and connected to WiFi, and, in fact, being locked is required.
    You cannot get to the Settings icon if the iPhone is locked.  You would have to unlock it first.
    All the above assumes "locked" means you have the iPhone passcode locked, and may or may not remember the unlock passcode.

  • How to make a envelop distort like in this image

    Hey guys I wanted to know how can i make a envelop distort like this image in adobe illustrator CS6. Im running it on Windows 7.

    I still believe the originator of the artwork at least tried to keep to the straight and narrow. The crucial question is whether Hunter wishes to (too).
    When zooming in as far as possible on the image (so it is 190 mm wide on screen), as far as I can see, the spaces are still constant width and the lettershapes at top and bottom are still straight, especially evident for the TE at the end, so I believe any deviation would be an inaccuracy. The rounding of the basically horizontal segments as in Envelope (or Art Brush) Distort should be clearly visible.
    I believe Hunter may be able to make sure by zooming in on the actual artwork, and maybe measuring distances between key Anchor Points, and/or dragging with the Line Tool between them, in the latter case the top of the TE would show the greatest deviance from straightness.

  • How to print modifier key symbols

    How csn I print the symbols for Apple modifier keys in a document?
    Thank you.

    The Apple modifier keys can be found in the Special Characters (control+command+Space) panel. Look for everything but caps lock and shift under the Technical Symbols category. The caps lock and shift key symbols are found under Arrows. Select the character, and then in the lower right under Font Variation, click on the symbol whose font name matches that in your document. Double-click the character to have it inserted into your document at the desired insertion point.
    If you do not see Arrows and Technical Symbols in your Special Characters panel, click the gear icon in the top panel and add them.

  • How to make a key field manadatory, in a Z-Table (SE11)

    Hi,
    I've created a Z-table is se11 and one of the key fields is IWERK. Now the user does not want this field to be blank when they enter data into the table via SM30.
    Does anyone know how to make this field so that a blank entry is not acceptable.
    Many Thanks!

    Hi Robert!
    One way would be to adjust SM30 to a mandatory field (in SE11 of course), but this field sounds like you can assign T001W as a check table. In the foreign key definition, you can give a error message, which is called in case of wrong entries in screens -> there is no empty entry in T001W, you can only maintain valid values and got a value list.
    Regards,
    Christian
    P.S.: No, you need to change SE11->Table maintenance generator->Enviroment->Modification->Maintenance Screens->Element list->Tab Special attr. column Input. Set 'required'. Otherwise empty is still allowed
    Message was edited by: Christian Wohlfahrt

Maybe you are looking for

  • OIM 9.1.0 behaves weird during installation

    Hi All, I am trying to install OIM 9.1.0.1 on the following configuration: OS: Windows 2003 server SP2 jdk: Sun jdk1.5.0_12 App Server: jboss 4.2.3.GA database: Oracle 10g I have successfully installed java, and database and run the prepare_xl_db.bat

  • How do I add a delay to boot time?

    Win 8.1 boots too quickly to be able to get into safe mode, sometimes even to get into BIOS. I unchecked the faststart under the power settings. Is there anyplace I can put in a time delay before the windows boot process starts ? Bill Riggs

  • Does media hub support mov video format?

    Most of my video files are stored as .mov format. I just found out that none of these video files show up the media browser. I carefully checked the datasheet and user manual. On data sheet, it's shown as supported. On user manual, it's not in the li

  • Can't lock screen in KDE

    Hello guys, Please give me advice - how can i debug problem with screen locking in KDE? I don't find any similar problems in arch forums/mailing lists. This problem appeared after update. Standart Ctrl+Alt+L doesn't work, plasma applet (screen lock)

  • How to write pcr

    hi gurus can you help me out to write a new rule For employees with pension factor  wage type 0500 for pension factor, the disability insurance will be contributed on the Pensionable Salary. For this we need to create a new rule / constant and the sa