AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Modal keyboard remapper

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
manicm



Joined: 24 Nov 2006
Posts: 1
Location: Ljubljana / Slovenija

PostPosted: Fri Nov 24, 2006 3:01 pm    Post subject: Modal keyboard remapper Reply with quote

Hi

At http://www.autohotkey.net/~manicm/kbdmodal.ahk
you can find a script that enables you to use the keyboard in
3 different modes. The logic is similar to the vi editor.
It enables you to keep the hands on the homeline most of
the time.

The modes are: Write(default), Command and Keypad.
You use CapsLock to select the active mode.
In command mode it is possible to use a prefix argument to
repeat the next keypress multiple times.

The code and the compiled script are in
http://www.autohotkey.net/~manicm/kbdmodal.zip

Documentation from the file:
Code:

;;
;; kbdmodal.ahk
;;
;; Author: Marko Mahnič
;; Description:
;;      Keyboard remapper with 3 modes of operation: Write, Command and
;;      Keypad. To enter the command mode press CapsLock. To enter
;;      the Kepyad mode press Alt-CapsLock. To toggle the CapsLock state
;;      press Shift-CapsLock.
;;
;;      Command mode (on english keyboard)
;;         - ijkl   Send up/left/down/right
;;         - um     Send home/end
;;         - o.     Send page up/down
;;         - xcv    Send Ctrl-X/Ctrl-C/Ctrl-V (clipboard cut/copy/paste)
;;         - w      Select the write mode (also active in KP mode)
;;         - qa     Prefix next character with Ctrl/Alt
;;         - s      Popup the selection menu
;;         - Ctrl-S Send Ctrl-S (usually save)
;;         - d      Send Delete
;;         - Ctrl-Z Send Ctrl-Z (usually undo)
;;         - 0..9   Prefix argument (max 3 digits; Esc to cancel)
;;
;;      The current mode is displayed in a semi-transparent window.
;;      The prefix argument works with all movement commands and with
;;      the commands: v, w, s, d. It also works with arrow keys and
;;      the numeric keypad (NumLock Off).
;;
Back to top
View user's profile Send private message
MisterW



Joined: 20 Jul 2005
Posts: 65

PostPosted: Sun Nov 26, 2006 12:55 pm    Post subject: Reply with quote

Strange!!!
I had almost exactly the same idea a week ago. I don't have time to read thru your script but will check it out when I do - it looks great. My script had caps as a toggle between modes and replaced it's default behaviour with caps + f.
I think it's a good idea as caps is rarely used for it's original purpose and switching a mode is easier than remember (or trying to type) awkward key combinations.Being a vim user this works well for me but I'm still not sure about the best implementation.
The modes I choose were:
1. Default (does what you would expect)
2. Extended (you can remap function keys and extended keys (vol_up etc) on a per applicaton basis)
3. Control (every key is remapped as desired)
4. System (keys work to move mouse,close windows etc)

Cyclying thru 4 modes is a bit much so I'm trying to refine the concept and make it more practical. Also I use a different icon in the tray for each mode so you know where you are.

An example of Extended mode is remapping function keys in explorer to change view modes and sorting behaviour. Quicker than using the mouse.

I'm interested in exploring the vim methodology further...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group