31093Re: caps lock
- Aug 7, 2002
>> Wouldn't it be nice if VIM couldHi Sven,
>> have an option to ignore Caps Lock in the normal, visual and
>> operator-pending modes, but not in Command-line and Insert modes?
>Quite a faq... There are only three problems:
>- Caps lock can not be detected on all systems VIM supports
>- noone's willing to implement this feature
>- I'm not (yet) able to code that :-)
>Since I sometimes have to code in all UPPERCASE I help myself by imapping
>uppercase to lowercase and the other way round.
Thank you. I didn't even realise that this such a frequent request. It
just seemed logical to me. I believe that detecting the caps lock is
possible both on Windows, and under X11. I do not think that it's possible
under terminal mode, and I have no idea under other systems. Would this be
the first platform specific feature? Just make it unavailable or inactive
on the platforms that don't support it.
It would take me a while to figure out how to code up a new option in VIM.
For someone that's done that before, the implementation itself should be
straightforward. If there is some central event loop, one can simply
toggle the capitalization of the key event based on the current editing
mode (and the option setting) and pass things onward for processing as
usual. It should not be prone to many bugs. Of course, this design really
depends on whether such a central location for the change exists, and I
haven't looked at the VIM source, so I don't know that.
Also, I can help find the caps lock detection code on both Windows and
X11. There are lots of those little screen-keyboard diode programs, that
may come with source code, for example. Moreover, the API for something
like this should be documented.
All the best,
* Rimon Barr Ph.D. candidate, Computer Science, Cornell University
| barr@... - http://www.cs.cornell.edu/barr - Y!IM: batripler
| Understanding is a kind of ecstasy.
+---- -- Carl Sagan
- << Previous post in topic Next post in topic >>