Author Topic: The Squeezeboard: moving all keys into the home area with AutoHotkey  (Read 18919 times)

0 Members and 1 Guest are viewing this topic.

Offline Rajagra

  • Thread Starter
  • Posts: 1930
There have been many hardware attempts to cram all the keys of an extended keyboard into a smaller area, with varying degrees of success. Most of them turn out to be horribly cramped or badly thought out in one way or another.

I wondered if there was a way to duplicate all of the extended keys into the main alphanumeric block, in a logical way, without spoiling the layout and spacing. Well I think it is possible, and AutoHotkey has allowed me to emulate what I think such a keyboard would look like.

Here is the layout.



The AutoHotkey script to do this is attached, just rename it from .txt to .ahk

The CapsLock key acts as a Fn modifier key. You can change to using another key by editing the first few lines of the script. EDIT> Now selected at start-up by menu.

Unfortunately, on my machine, AutoHotkey seems unable to fully block the action of CapsLock. It may be because of the Logitech Dinovo software I have running.  If you have the same problem, you can do what I did: Use KeyTweak to remap the CapsLock key to become "Macintosh Keypad =". Then in the script select the "FnKey=SC 059" option. Works really well.
EDIT>Works better with CapsLock now, but hit Shift-Capslock to toggle state if needed.

Where useful, I've allowed keys to work with modifiers, e.g. Alt-F4, Shift-End, etc. But only one modifier at a time, I'm afraid, until my AHK skills improve. EDIT> now works with combinations of modifiers.

I've noticed putting the numeric pad's dot on the Alt-Gr key works once then confuses AHK until you release the Fn key, so I've duplicated it on the N key for now. EDIT> This problem only happens in some circumstances, may even be fixed?

I hope you try it and find it useful. Or at least agree the concept gives hardware manufacturers food for thought. Thanks for looking.
« Last Edit: Thu, 16 July 2009, 08:55:02 by Rajagra »

Offline Rajagra

  • Thread Starter
  • Posts: 1930
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #1 on: Fri, 10 July 2009, 19:08:44 »
Yes, first I added the option to change which key is used as Fn, and later added the use of modifier keys, so using Ctrl as Fn does now have that effect.

I can add a workaround, try this version (attached.)

You should be able to use right control as a modifier still. I.e. left control is Fn, using both control keys will allow Ctrl-left arrow, etc.

(1 other small change - media keys are now YHB so they form a line.)

Edit> Ver 1.02 of script on main page now.
« Last Edit: Fri, 10 July 2009, 20:29:43 by Rajagra »

Offline Rajagra

  • Thread Starter
  • Posts: 1930
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #2 on: Wed, 15 July 2009, 23:28:54 »
Updated. Ver 1.04.

Now works with alternative keyboard layouts (well, at least Colemak is tested). Done by referencing AHK scan codes instead of letter descriptions.

Works much better with Ctrl/Alt/Shift modifiers, e.g. you can do ctrl-shift-right arrow to highlight words in an editor.

Works a bit better with Ctrl/Alt/Shift working as the Fn key.

Has a menu when you start it up to select which key to use as the Fn key.

Changed Num Lock to be done by Alt-Fn-Tab. Mainly because Shift-Fn-Tab makes more sense if it acts as Caps Lock.

If you use Caps Lock as the Fn key, you can operate Caps Lock by pressing Shift-CapsLock. In fact you would have to, because Shift-CapsLock-Tab won't work, AutoHotkey gets confused for some reason I can't resolve.


EDIT> Argh, noticed another small problem. If you are using CapsLock as the Fn, and allow the other key you pressed to auto repeat, a few of these keys can slip past AHK. E.g. Holding down CapsLock-d to move right will move continuously, but drop "d"s in every so often. Not good. This is a shame because using CapsLock as a modifier is a dream from a comfort point of view. I will remap my CapsLock as a Mac Key again to get around this.
« Last Edit: Thu, 16 July 2009, 00:08:30 by Rajagra »

Offline nanu

  • Posts: 290
    • http://T-T.be/portal
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #3 on: Sun, 02 August 2009, 15:46:27 »
Thanks for this script. I'm using its numpad functionality for my tenkeyless, and it works thus far using Media Mute as a Fn key (assigned to Caps Lock years ago using sharpkeys).

Offline wellington1869

  • Posts: 2885
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #4 on: Sun, 02 August 2009, 16:27:58 »
Quote from: ripster;106254


 I end up suspending AutoHotkey as a workaround for browsing but if you have any ideas let me know.

.


you can make it behave differently based on what window is currently active ("ifwinactive" command). Is that what you're looking for?  So you can make it do something different if firefox is the active window, for instance.

Whats the "fcn" key? Do you mean your autohotkey hotkey? Or the Fn key on the laptop keyboard?

"Blah blah blah grade school blah blah blah IBM PS/2s blah blah blah I like Model Ms." -- Kishy

using: ms 7000/Das 3

Offline Rajagra

  • Thread Starter
  • Posts: 1930
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #5 on: Sun, 02 August 2009, 16:37:55 »
Quote from: ripster;106254
I end up suspending AutoHotkey as a workaround for browsing but if you have any ideas let me know.


The most bulletproof approach is to use KeyTweak to reprogram the desired Fn key to act as a Macintosh = key, then choose that option when you run my script.


Offline wellington1869

  • Posts: 2885
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #6 on: Sun, 02 August 2009, 16:50:41 »
raj, how are you recognizing "macintosh keypad =" key in autohotkey? (ie, whats the ahk name for it? I'm not seeing it in the help file).
I assume you have a scancode number for it?

I used keytweak to assign win key to my alt keys, but come to think of it, assigning it to a non-existent key (nonexistent on windows side, like a mac key) would be better.
« Last Edit: Sun, 02 August 2009, 16:54:12 by wellington1869 »

"Blah blah blah grade school blah blah blah IBM PS/2s blah blah blah I like Model Ms." -- Kishy

using: ms 7000/Das 3

Offline Rajagra

  • Thread Starter
  • Posts: 1930
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #7 on: Sun, 02 August 2009, 16:52:00 »
I wonder if this might work too:

Use AHK to swap the left and right Ctrl keys;
Use right-Ctrl as the Fn key (which will now be the one on the left!)

Hopefully the mouse sends left-Ctrl and now won't trigger my script.

The advantage (assuming it works) is that if you stop the script you will have two working Ctrl keys.

Offline Rajagra

  • Thread Starter
  • Posts: 1930
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #8 on: Sun, 02 August 2009, 16:58:16 »
Quote from: wellington1869;106262
raj, how are you recognizing "macintosh keypad =" key in autohotkey? (ie, whats the ahk name for it? I'm not seeing it in the help file).


It is seen as SC059

I found this by using View / Key History from the AHK window (double-click the green H in the task tray.) Press any keys you want the codes for then F5 to refresh.

Offline wellington1869

  • Posts: 2885
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #9 on: Sun, 02 August 2009, 16:59:38 »
Quote from: Rajagra;106266
It is seen as SC059

I found this by using View / Key History from the AHK window (double-click the green H in the task tray.) Press any keys you want the codes for then F5 to refresh.


thanks. (I just read your article ;D "remap the CapsLock key to become "Macintosh Keypad =". Then in the script select the "FnKey=SC 059" option")

remapping to win keys worked well for me except on one key -- win+L still sometimes produces "logoff" which is annoying :)
This would solve that.

"Blah blah blah grade school blah blah blah IBM PS/2s blah blah blah I like Model Ms." -- Kishy

using: ms 7000/Das 3

Offline Rajagra

  • Thread Starter
  • Posts: 1930
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #10 on: Thu, 20 August 2009, 12:27:15 »
When I find a Japanese board to play with, I'll add those scan codes into the script. The only ones I've found cheap to the UK so far are those roll-up silicone ones. {Shiver.} Oh well, at least they boast "no poisonous and evil smell".

Offline GenEric35

  • Posts: 121
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #11 on: Tue, 10 November 2009, 20:27:59 »
Hi, I started using this script with Caps Lock as the Fn key. This script is great because it keeps all my other keys as default and brings the far keys closer to the home keys, not that i'm too lazy but closer is faster.

And the script prompts you to pick the key you want to use as Fn key. All those are awesome features, in my case i use them for text editing.

I do have a question or maybe an something I found that could be a 'bug' when using the some shortcuts, the first one is specific to windows 7.

a)When doing Windows + Left Arrow, it should dock a window on the left side of the screen, instead it takes windows+capslock and turns caps lock on and the arrow is ignored.

b)To select until text from here to the end of the file, i'd normally do control+shift+end but i think the third key(in this case "End") is ignored.

I'm just curious is someone else has seen those 2 issues, I'll take a look at this script to see if i can find what's happening exactly.

Thanks
« Last Edit: Tue, 10 November 2009, 20:49:45 by GenEric35 »
:target: HHKB Pro 2  
IBM Model M 1390131
Unicomp Customizer

Offline Rajagra

  • Thread Starter
  • Posts: 1930
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #12 on: Tue, 10 November 2009, 20:40:12 »
I'm sure that (b) at least is caused by lack of n-key rollover. I noticed similar problems when I changed keyboard.
Most keyboard matrixes are not designed with the expectation you will hold down CapsLock with other keys. It's a shame because CapsLock makes a wonderful modifier key.

Try Aqua's KeyTest to see which keys can be held down at once.

I don't have Win 7, so can't comment or test that.

EDIT> Corrected link.
« Last Edit: Tue, 10 November 2009, 20:50:17 by Rajagra »

Offline DreymaR

  • Posts: 184
  • Location: Norway
  • Colemak forum guy
    • DreymaR's Big Bag of Kbd Tricks
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #13 on: Fri, 13 November 2009, 03:32:28 »
GenEric: If you try with PKL (see http://www.autohotkey.com/forum/viewtopic.php?t=28447&start=75), does the same problem apply there?

My own layout has the arrow keys on the right hand and sacrifices the NumPad (which I plan to include in a separate 'extend' state instead). Otherwise, there are markant similarities. I love doing this kind of thing!
Better burden you cannot carry than man-wisdom much ~ Hávamál

Offline Rajagra

  • Thread Starter
  • Posts: 1930
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #14 on: Thu, 03 December 2009, 21:55:12 »
I thought I'd give some tips on modding my script, as there have been a couple of queries. It should be quite easy to do if you follow these steps:

In the "Map keys to actions" section, delete or comment out (with a ; at the start of the line) any lines you don't need the mappings for.
You don't need to delete anything in the "Define actions" section, but you can if you want.

Any actions you want to move to different keys, change the line in the "Map keys to actions" section.
E.g. if you want the J key to act as Left, instead of A, change
Hotkey, %FnKey% & SC01E, Fn_Left ;a
to
Hotkey, %FnKey% & SC024, Fn_Left ;j
or if you are using a QWERTY layout, simply
Hotkey, %FnKey% & j, Fn_Left

If you know which key you want to use as the Fn key and want to bypass the initial menu, comment out the line
Menu, ChooseFnKey, Show
by putting a ; at the start, then follow with a line to set your Fn key. For example:
;Menu, ChooseFnKey, Show
FnKey=RControl

Also, comment out or delete the line
Hotkey, %FnKey%,Fn_BackSpace
if you don't like the Fn key on its own acting as backspace. I keep enabling and disabling that option myself, it can be annoying.

You can find the scan codes for keys by running any AutoHotkey script, double clicking the icon, use View/Key history, pressing the key(s) of interest then F5.

I'm attaching an example version that copies the navigation keys of the HHKB, everything else is disabled. Right control acts as Fn.
« Last Edit: Thu, 03 December 2009, 21:59:44 by Rajagra »

Offline Brodie337

  • Posts: 414
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #15 on: Tue, 06 July 2010, 02:20:11 »
I've just started playing around with this, it looks really promising.

The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #16 on: Tue, 06 July 2010, 07:31:15 »
Quote from: Brodie337;199874
I've just started playing around with this, it looks really promising.

I'm currenty using the following xmodmaprc file to do this in linux. Note that it uses "Mode_Switch" as the selecting key for the additional layer, which may conflict with users of "Alt Gr" for accented characters. I ran out of modifiers, since I'm on an original model M and also needed "Super" for window management (there's nothing more annoying than having a keyboard shortcut that's used by both an app and the windowing system).

If needed, it's still possible to use one of the "Alt" keys as Hyper/Mod3/Num Lock to squeeze in "Alt Gr" behavior, I suppose.

This layout has j as the "left" key and i as the "up" key, giving you cursor movement without any hand movement.

Code: [Select]
! +--+--+--+--+--+--+--+--+--+--+--+--+--+----+
! |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |BSPC|
! +--++-++-++-++-++-++-++-++-++-++-++-++-++---+
! |TAB|q |w |e |r |t |y |u |i |o |p |[ |] |\  |
! +---++-++-++-++-++-++-++-++-++-++-++-++-+---+
! |CTR |a |s |d |f |g |h |j |k |l |; |' |ENTER|
! +----++-++-++-++-++-++-++-++-++-++-++-+-----+
! |SHIFT|z |x |c |v |b |n |m |, |. |/ |SHIFT  |
! +---+-+-+---+--+--+--+--+--+--++-+-++---+---+
! |MOD|   |ALT|                  |ALT|    |SUP|
! +---+   +---+------------------+---+    +---+

! +--+--+--+--+--+--+--+--+--+--+--+--+--+----+
! |ES|f1|f2|f3|f4|f5|f6|f7|f8|f9|f0|f1|f2|DEL |
! +--++-++-++-++-++-++-++-++-++-++-++-++-++---+
! |TAB|  |  |  |  |  |  |PU|^ |HO|  |  |  |INS|
! +---++-++-++-++-++-++-++-++-++-++-++-++-+---+
! |CTR |  |  |  |  |  |  |<-|v |->|  |  |ENTER|
! +----++-++-++-++-++-++-++-++-++-++-++-+-----+
! |SHIFT|  |  |  |  |  |  |PD|  |EN|  |SHIFT  |
! +---+-+-+---+--+--+--+--+--+--++-+-++---+---+
! |XXX|   |ALT|                  |ALT|    |SUP|
! +---+   +---+------------------+---+    +---+


! modifiers
clear Lock
clear Control
clear Mod4
keycode 66 = Control_L
keycode 105 = Super_R
keycode 37 = Mode_switch

add Control = Control_L
add Mod4 = Super_R

! top row
keycode  49 = grave asciitilde Escape
keycode 10 = 1 exclam F1
keycode 11 = 2 at F2
keycode 12 = 3 numbersign F3
keycode 13 = 4 dollar F4
keycode 14 = 5 percent F5
keycode 15 = 6 asciicircum F6
keycode 16 = 7 ampersand F7
keycode 17 = 8 asterisk F8
keycode 18 = 9 parenleft F9
keycode 19 = 0 parenright F10
keycode 20 = minus underscore F11
keycode 21 = equal plus F12
keycode 22 = BackSpace NoSymbol Delete NoSymbol

! second row
keycode 30 = u U Prior
keycode 31 = i I Up
keycode 32 = o O Home
keycode 51 = backslash bar Insert

! home row
keycode 44 = j J Left
keycode 45 = k K Down
keycode 46 = l L Right

! bottom row
keycode 58 = m M Next
keycode 60 = period greater End
« Last Edit: Tue, 06 July 2010, 07:36:50 by Superfluous Parentheses »
Current collection: HHKB Pro 2 black on black, HHKB Pro 2 white/grey blank, [strike]Dell AT101W[/strike] (sold to SirClickAlot), 1992 Model M, Key Tronic Ergoforce KT 2001, BTC 5100 C. Dead boards: MS Natural Elite, MS Natural 4000.

Offline Brodie337

  • Posts: 414
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #17 on: Sat, 10 July 2010, 02:04:54 »
Thats awesome. I'll give that a go.

Offline steeef

  • Posts: 156
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #18 on: Tue, 04 January 2011, 14:33:11 »
Bumping this, as it's a great script. I already use AutoHotkey for random shortcuts, but I've integrated this script into my own. Very useful now that I'm using a Filco Tenkeyless as my main board.
Cherry MX Blue: Filco Majestouch Tenkeyless. Cherry MX Black: TG3 KBA-BLTD-5RBUVS (Police Cruiser keyboard). Cherry MX Clear: KBC Poker (modded with Ergo Clears) Cherry MX Brown: Goldtouch GTC-077 USB numpad. Buckling Spring: IBM Model M 1391401 (1989-01-03 and 1991-11-21).

Offline richie

  • Posts: 15
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #19 on: Sun, 29 May 2011, 02:08:25 »
Thanks Rajagra,
Looks like a well thought out layout. Going to give this a go but will swap out the tilde for the escape key since I use that a whole lot more and have caps lock as a modifier since I don't use that at all!

Offline Zet

  • Posts: 304
The Squeezeboard: moving all keys into the home area with AutoHotkey
« Reply #20 on: Sun, 29 May 2011, 22:54:44 »
Woah, this looks pretty nice, pretty nice. I would really love to get something similar plus some tweaks for spanish keys needed, like ´ key to get áéíóú and the ñ key... I'll have to give some good reading at AHK manuals/forums :)