![]() |
|
[Linux] How to Change the Caps-Lock Behaviour |
Bernardo Lopes
Member #7,318
June 2006
![]() |
Every Linux flavour gives me this issue: The Caps-Lock key, that I use to capitalise sentences, only toggles the capitalisation modifier when I release said key. Instead, I want it to toggle (and lock) the capitalisation modifier when I simply press the key, disregarding if I ever release said key. That's the behaviour of Windows. I don't use the Shift key because I learned how to type relying on the Caps-Lock key to those jobs. I don't intend to re-learn how to type unless I have absolutely no way around this. I tend to hold the Caps key a little longer on some sentences, thus outputing this: "THis IS AN EXample SEntence". Obviously I posted this on the Ubuntu Forums (since that's the distro I use). The original post is here: How to Change Caps Lock Behavior But so I far I failed to find a fix. If you guys have something to say to help me, please do. Thanks.
|
SiegeLord
Member #7,827
October 2006
![]() |
This appears to be a bug, actually, as it is inconsistent. When you start in a capslock off state, and then press capslock, the letters start getting capitalized. When you are in capslock on state, and then press capslock, nothing happens. Only when you release capslock in the second scenario do the letters go back to normal. Either the state change should be dependent on the KEY_PRESSED event in both cases, or on KEY_RELEASED in both cases, not one or the other depending on the current state. I guess you'd need to find whatever is responsible for keyboard input (Xorg?) and submit a bug report. Alternatively, someone could look at the driver and see if it can be fixed manually so you can recompile it for your system. EDIT: Just tested it, and the same inconsistency happens with Num lock. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Bernardo Lopes
Member #510
July 2000
![]() |
SiegeLord you seemed to have nailed it exactly! Summarising all the Ubuntu thread in a single post. Maybe I should do that as you described but I'll refrain to tag it as a "bug" yet. I'm fairly new to Linux so I don't know how accessible/simple is to simply pick-up the corresponding piece of code, try to change it and recompile. Do you have any pointers on that? Or maybe it's way out of my league. Anyway I'll look into the responsible party that deals with keyboard. Thanks. [edit]
|
kazzmir
Member #1,786
December 2001
![]() |
It works for me in aterm although it doesn't work in firefox (I mean I get the behavior you describe in firefox). So maybe your bug should be sent to firefox and not xorg? I'm fairly sympathetic to typing issues even if they are different from my own but I really don't see the point of using capslock to capitalize single letters. Thats exactly what shift is for. I mean it sounds like how you would type 'The' is press caps It seems much easier to me to type press shift I could see how you might leave your finger pressed on the shift key, thus capitalizing H but you are already doing extra work by pressing caps again so it seems strange. |
Matthew Leverton
Supreme Loser
January 1999
![]() |
I'd file this bug under the "Keyboard to Chair Interface Failure" category. |
Bernardo Lopes
Member #510
July 2000
![]() |
Yes kazzmir, the first one is what I do. I know that the vast majority of people find this awkward. I'm just saying that I learned how to type without following any formal method, thus acquiring the bad habit of overusing the Caps-Lock key. The fact that I have been discriminated with the use of sarcastic humor and some angry posts is very peculiar. I didn't knew it was a subject that touched people passions towards OSes or that made me look intellectually handicapped. And I'm not saying that Linux should accommodate this. I only asked if there was a way to change that behaviour. The answers were: "file a bug to the proper keyboard related party, or patch/wrap the kernel keyboard code to your likings and rebuild" and "Learn how to type the proper way". Thanks for the help guys.
|
kazzmir
Member #1,786
December 2001
![]() |
Bernardo Lopes said: I'm just saying that I learned how to type without following any formal method, thus acquiring the bad habit of overusing the Caps-Lock key. Self-pity won't win you any points. I wasn't taught formally either, I just do whatever comes naturally. Pressing the caps-lock key might come naturally for you as well, I was just commenting that its very strange that it would come naturally at all considering how much harder it is to press caps-lock twice than it is to hit shift once. Anyway, have you determined if its application specific or does it happen everywhere? You can probably just remap caps-lock to shift using xmodmap. |
SiegeLord
Member #7,827
October 2006
![]() |
For me I get the bad behaviour in every application I tested (including aterm). "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Thomas Fjellstrom
Member #476
June 2000
![]() |
I wouldn't call it "bad". Caps lock is a SWITCH not a regular button. Its state toggles. Why in heck you'd expect it to act like SHIFT I'll never know. -- |
Timorg
Member #2,028
March 2002
|
I just tested it with ubuntu, under X.Org and by switching to an actual console. Under X it doesn't revert to normal caps until the button is released. Under the console, it behaves as it does in windows, so its an X.Org behavour. I do find how you type a little odd, as the T, A, E & S are all usually typed using the right shift key. Caps-lock->A->Caps-lock is a lot more work than right shift+A. But if its the way you want to type, so be it. ____________________________________________________________________________________________ |
Arthur Kalliokoski
Second in Command
February 2005
![]() |
Why would you hold down a shift lock? Just a quick peck with your pinky and you're done. They all watch too much MSNBC... they get ideas. |
Timorg
Member #2,028
March 2002
|
If I was going to look at fixing the problem, I look at any code that does something like PostEvent(pInfo, KEY_CapsLock, TRUE) function in kbd.c or maybe other X.Org sources. ____________________________________________________________________________________________ |
BAF
Member #2,981
December 2002
![]() |
I hardly EVER use my right shift key. In fact, I mainly use it just for playing games. Capital A, E, S, etc I use left shift for too. Shift with right pinky, index finger for T, ring finger for A, and middle finger for E and S. |
bamccaig
Member #7,536
July 2006
![]() |
Yeah, AFAIK, I only use left-shift. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Bernardo Lopes
Member #510
July 2000
![]() |
kazzmir said: Self-pity won't win you any points. I had to look the expression "self-pity" on Google to understand it. If I understand correctly it was an insult. You've interpreted my post the wrong way. I wrote in an impartial way, only describing the scenario for you guys information. Re-reading my post again I think that starting the sentence with "I'm just saying" made me sound that way. kazzmir said: Anyway, have you determined if its application specific or does it happen everywhere? Happens in every application that I've used. I'm taking a touch-typing tutorial to overcome my disability.
|
bamccaig
Member #7,536
July 2006
![]() |
Bernardo Lopes said: I'm taking a touch-typing tutorial to overcome my disability.
It's not a disability. Just a quirk. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Simon Parzer
Member #3,330
March 2003
![]() |
Well, X.org had the same problem concerning the SHIFT key. If you'd do the following: Press c it would result in 'cd 7', where I was obviously trying to type 'cd /'. Took them several months to fix it. |
bamccaig
Member #7,536
July 2006
![]() |
Clearly your keyboard is different from mine because for me, the '/' (and '?') key is next to right-shift whereas shifted '7' results in '&'. I know that on my Eee PC 1000, which tries to support Chinese typing out of the box, it freaks out when I hit space while holding the shift key. It changes the keyboard configuration automatically and results in really awkward output. It was very alarming when I didn't know why it was doing that. Perhaps something similar is happening for you? You might want to look into your keyboard configuration (i.e., which keyboard is selected and what kinds of configuration options are available). Clearly if shift is down when you press the '7' key it should result in the shifted key press unless something changes when you press shift+space. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
relpatseht
Member #5,034
September 2004
![]() |
I never thought I'd know of two people with that particular quirk.
|
MiquelFire
Member #3,110
January 2003
![]() |
Simon, what type of keyboard do you have? --- |
SiegeLord
Member #7,827
October 2006
![]() |
Thomas Fjellstrom said: I wouldn't call it "bad". It's bad because it is inconsistent, no matter what people use it for. Either the key press should reset the state, or key release should reset the state, not one or another at differing times. Plus, as the OP said, this also leads to the mismatch between the actual Caps Lock state and the Caps Lock LED and which does get reset by the key down event. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Timorg
Member #2,028
March 2002
|
It would be nice if it was consistant between the console and X. ____________________________________________________________________________________________ |
Thomas Fjellstrom
Member #476
June 2000
![]() |
SiegeLord, X is not Windows. Get over it But that oddness of shift being ignored in the following sequence does seem like a bug: Press c Release c Press d Release d Press space Press shift Release space Press 7 (shift still pressed)
-- |
BAF
Member #2,981
December 2002
![]() |
SiegeLord has a very valid complaint. |
alethiophile
Member #9,349
December 2007
![]() |
I agree that the caps lock inconsistent behavior is a bug, though not one I've ever had a problem with (I remap capslock to ctrl, to use emacs). I can't imagine it's too serious for most people, though, as most people who use it at all use it as a switch. -- |
|