Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Half-QWERTY: One-handed Typing


  • Please log in to reply
173 replies to this topic
jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
One-handed typing as a theory has been floating around for a long time. In fact, the first prototypes of the mouse were tested while using a one-handed keyboard, which usually mirrors both sides onto one. For more information on one-handed typing and the Half-qwerty layout I used for this, visit this link. There are already programs that do this, but I have yet to find a free one. Of course, if you really like this, you might consider a half-qwerty keyboard, a true half-keyboard, or a more exotic (and more proprietary) Frogpad.

What this script does is it remaps the spacebar to be a modifier. When space is held, the keyboard is inverted, with the line of symmetry between g and h. Thus, e would become i, b would become n, p would become q, and so on. If the spacebar is depressed and released without pressing any other keys, a single space is sent. Modifier keys such as shift or control can be used in conjuction with Half-qwerty.

; Many thanks to Chris for helping me out with this script.

mirror_1 = 0
mirror_2 = 9
mirror_3 = 8
mirror_4 = 7
mirror_5 = 6
mirror_q = p
mirror_w = o
mirror_e = i
mirror_r = u
mirror_t = y
mirror_a = `;
mirror_s = l
mirror_d = k
mirror_f = j
mirror_g = h
mirror_z = /
mirror_x = .
mirror_c = ,
mirror_v = m
mirror_b = n
mirror_6 = 5
mirror_7 = 4
mirror_8 = 3
mirror_9 = 2
mirror_0 = 1
mirror_y = t
mirror_u = r
mirror_i = e
mirror_o = w
mirror_p = q
mirror_h = g
mirror_j = f
mirror_k = d
mirror_l = s
mirror_n = b
mirror_m = v
return


; This key may help, as the space-on-up may get annoying, especially if you type fast.
Control & Space::Suspend

; These keys are optional, but they may help if you are typing on the left-hand side.
CapsLock::Send, {BackSpace}
Space & CapsLock::Send, {Enter}

; If spacebar didn't modify anything, send a real space keystroke upon release.
space::
Send {space}
return

space & 1::
space & 2::
space & 3::
space & 4::
space & 5::
space & q::
space & w::
space & e::
space & r::
space & t::
space & a::
space & s::
space & d::
space & f::
space & g::
space & z::
space & x::
space & c::
space & v::
space & b::
space & `;::
space & ,::
space & .::
space & /::
space & 6::
space & 7::
space & 8::
space & 9::
space & 0::
space & y::
space & u::
space & i::
space & o::
space & p::
space & h::
space & j::
space & k::
space & l::
space & n::
space & m::
; Determine the mirror key, if there is one:
if A_ThisHotkey = space & `;
   MirrorKey = a
else if A_ThisHotkey = space & ,
   MirrorKey = c
else if A_ThisHotkey = space & .
   MirrorKey = x
else if A_ThisHotkey = space & /
   MirrorKey = z
else  ; To avoid runtime errors due to invalid var names, do this part last.
{
   StringRight, ThisKey, A_ThisHotkey, 1
   StringTrimRight, MirrorKey, mirror_%ThisKey%, 0  ; Retrieve "array" element.
   if MirrorKey =  ; No mirror, script probably needs adjustment.
      return
}

Modifiers =
GetKeyState, state1, LWin
GetKeyState, state2, RWin
state = %state1%%state2%
if state <> UU  ; At least one Windows key is down.
   Modifiers = %Modifiers%#
GetKeyState, state1, Control
if state1 = D
   Modifiers = %Modifiers%^
GetKeyState, state1, Alt
if state1 = D
   Modifiers = %Modifiers%!
GetKeyState, state1, Shift
if state1 = D
   Modifiers = %Modifiers%+
Send %Modifiers%{%MirrorKey%}
return


Chris
  • Administrators
  • 10727 posts
  • Last active: Nov 15 2014 07:47 AM
  • Joined: 02 Mar 2004
Looks great. Might be especially useful for players of flight sims who want to type messages without crashing the plane :)

cr33p
  • Members
  • 5 posts
  • Last active: Nov 17 2004 06:45 PM
  • Joined: 21 Oct 2004
Xlnt! I've been looking for a one-handed keyboard for some time - gotta prep the one-handed typing for when our next son arrives in January, so's I can still chat and hold the baby at the same time, heh.

Awesome to see this accomplished in AHK :] Now, where to turn for tutorials and drills on how to actually learn how to type faster than two words a minute ...

Incidentally, how difficult would it be to remap this setup to use only the number pad, as seen here: http://www.fourtytwo...d/one-hand.html - cause that's just pretty sexy.

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
I actually have heard of this before, but it didn't come to my mind as I was making this because I have a laptop. The numpad is almost impossible to use since it takes up half of the keyboard if it's activated. However, I do have a spare keyboard I can plug in if I need, which I do quite often. I'll see if I can whip something up. (As soon as I figure the logistics out. The page is somewhat confusing)

  • Guests
  • Last active:
  • Joined: --

I'll see if I can whip something up. (As soon as I figure the logistics out. The page is somewhat confusing)


This looks like a much simpler system for using the numpad - two keystrokes per letter

http://www.thumbscri...howitworks.html

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
Thank you VERY much, guest. Heh. That system was confusing to say the least, and it's three-letter combos and quoting were driving me crazy. The script should be up sometime today. I'll release it first with only the defined combos, then I may add some of my own, to bring it closer to the regular keyboard functionality. (One area that old numpad method didn't lack in)

Watcher
  • Members
  • 60 posts
  • Last active: Apr 06 2005 01:57 PM
  • Joined: 27 Dec 2004
I am typing this one handed as we speak, I find it strange that I already seem to know the fingering.

I am going to try to use this exclusively for a while and give it an honest try, thanks for writing it!

Watcher
  • Members
  • 60 posts
  • Last active: Apr 06 2005 01:57 PM
  • Joined: 27 Dec 2004
I'm working on this part of your code:

; If spacebar didn't modify anything, send a real space keystroke upon release.
space::
  if A_TimeSinceThisHotkey < 300
  {
;    msgbox OK, %A_TimeSinceThisHotkey% ms since %A_ThisHotkey% was pressed
    Send {space}
  }
return

EDIT: Ok, I see now why that didn't work, but the question still remains, its it possible for me to know how long the user has been holding the space key and based on that time possibly ignore the keystroke all together?

to attempt to remove the problem of pressing space and realizing that you didn't need to in the first place as mentioned the paper you refered to:

If the user depresses the space bar (state 1) and holds it down past the timeout value, the state changes to 2. The timeout serves to reduce the number of erroneous spaces generated as a side-effect of using the space bar as a modifier key. Occasionally, a typist will depress the space bar with the intention of mirroring the state of another key but then change their mind and release. Without the timeout, such actions would result in an unwanted space character. With it, the problem is alleviated.

but it seems the TimeSinceThisHotkey is always 0 no matter what. Any ideas on this?

Watcher
  • Members
  • 60 posts
  • Last active: Apr 06 2005 01:57 PM
  • Joined: 27 Dec 2004
Unless there is a way to determine how long the space has been pressed that I have yet too find, I would say this is about all I can do with this script. I have had, and am still having a blast with it. Yea, I'm easily entertained. :shock: Here is the final version of the script.

; Many thanks to Chris for helping me out with this script.
; Capslock hacks and `~ remap to '" by Watcher

mirror_1 = 0
mirror_2 = 9
mirror_3 = 8
mirror_4 = 7
mirror_5 = 6
mirror_q = p
mirror_w = o
mirror_e = i
mirror_r = u
mirror_t = y
mirror_a = `;
mirror_s = l
mirror_d = k
mirror_f = j
mirror_g = h
mirror_z = /
mirror_x = .
mirror_c = ,
mirror_v = m
mirror_b = n
mirror_6 = 5
mirror_7 = 4
mirror_8 = 3
mirror_9 = 2
mirror_0 = 1
mirror_y = t
mirror_u = r
mirror_i = e
mirror_o = w
mirror_p = q
mirror_h = g
mirror_j = f
mirror_k = d
mirror_l = s
mirror_n = b
mirror_m = v
return

; This key may help, as the space-on-up may get annoying, especially if you type fast.
Control & Space::Suspend

; Not exactly mirror but as close as we can get, Capslock enter, Tab backspace.
Space & CapsLock::Send {Enter}
Space & Tab::Send {Backspace}

; Without this capslock would shift only letters, this resolves that issue.
+CapsLock::   ; Must catch capslock and Shift capslock to make this work.
CapsLock::
  if CapsState = D
  {
    CapsState = U
    Send {LShift Up}
  }
  else
  {
    CapsState = D
    Send {LShift Down}
  }
  return

Shift::CapsState = U  ; User pressed shift which toggles shift back up.
; The only strange part of this setup is that although capslock will toggle
; shift state, hitting the shift key will not toggle, it will act as a shift
; key reguardless of the capslock state and release afterward.


; If spacebar didn't modify anything, send a real space keystroke upon release.
space::
Send {space}
return

space & `::
space & 1::
space & 2::
space & 3::
space & 4::
space & 5::
space & q::
space & w::
space & e::
space & r::
space & t::
space & a::
space & s::
space & d::
space & f::
space & g::
space & z::
space & x::
space & c::
space & v::
space & b::
space & `;::
space & ,::
space & .::
space & /::
space & 6::
space & 7::
space & 8::
space & 9::
space & 0::
space & y::
space & u::
space & i::
space & o::
space & p::
space & h::
space & j::
space & k::
space & l::
space & n::
space & m::
; Determine the mirror key, if there is one:
if A_ThisHotkey = space & ``
   MirrorKey = '
else if A_ThisHotkey = space & `;
   MirrorKey = a
else if A_ThisHotkey = space & ,
   MirrorKey = c
else if A_ThisHotkey = space & .
   MirrorKey = x
else if A_ThisHotkey = space & /
   MirrorKey = z
else  ; To avoid runtime errors due to invalid var names, do this part last.
{
   StringRight, ThisKey, A_ThisHotkey, 1
   StringTrimRight, MirrorKey, mirror_%ThisKey%, 0  ; Retrieve "array" element.
   if MirrorKey =  ; No mirror, script probably needs adjustment.
      return
}

Modifiers =
GetKeyState, state1, LWin
GetKeyState, state2, RWin
state = %state1%%state2%
if state <> UU  ; At least one Windows key is down.
   Modifiers = %Modifiers%#
GetKeyState, state1, Control
if state1 = D
   Modifiers = %Modifiers%^
GetKeyState, state1, Alt
if state1 = D
   Modifiers = %Modifiers%!
GetKeyState, state1, Shift
if state1 = D
   Modifiers = %Modifiers%+
Send %Modifiers%{%MirrorKey%}
return


jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
Thanks for sharing, Watcher! I'll give it a go.

vorchatwo
  • Guests
  • Last active:
  • Joined: --
Why not just open your Keymap prog in:
start/programs/accessories/system tools
Then just double-click the text you want and hit the copy button.
It will copy it to the clipboard where you can paste it anywhere, in some instances it will put it directly into a prog (I think) such as Word.
Now if someone would write a program similar to Keymap but also include a clickable spot for us to customize. I.e. have 10 or so "letters" that can be customized to put out an entire word (like yes, no, the, etc), that would rock. Then all you would need to do is to click the letter or custom letter, hit copy, and paste it into what ever you want. Heck, a good programmer might be able to make the letters/strings show up (as it MIGHT with Word) in other programs like ICQ, AOL IM, etc.
If I knew how to write a font file it would be easy to just have your own font file (which is what the keymap prog works off from, i believe) and get rid of the keys you dont need. You just would have the customizable "letters" to use.
thats all, c-ya's

P.S. Check out the mouse stroke program called StrokeIt, it helps alot.

Watcher
  • Members
  • 60 posts
  • Last active: Apr 06 2005 01:57 PM
  • Joined: 27 Dec 2004

Why not just open your Keymap prog in:
start/programs/accessories/system tools
Then just double-click the text you want and hit the copy button.


I think you misunderstand what this program does. The purpose of the script is to permit one handed typing.

Now if someone would write a program similar to Keymap but also include a clickable spot for us to customize. I.e. have 10 or so "letters" that can be customized to put out an entire word (like yes, no, the, etc), that would rock.


This is just the type of thing AutoHotkey was made for, you might want to check into its ability to do something like type in 'btw' and have AutoHotkey translate that on the fly for you to 'by the way'. Is that what you were looking for?

Assistive Tech
  • Guests
  • Last active:
  • Joined: --
I was wondering if you could insert a onscreen keyboard that reflects the key-layout while the spacebar was pressed?

i.e. http://www.autohotke...ardOnScreen.htm

Thanks,

Assistive Tech

Chris
  • Administrators
  • 10727 posts
  • Last active: Nov 15 2014 07:47 AM
  • Joined: 02 Mar 2004
Do you mean show the on-screen keyboard while spacebar is pressed and hide it when space bar is released?

If you add the following two lines near the bottom of the script, that is close to a complete solution (the window appears upon startup but goes away the first time you release the space bar):

~space::Gui, Show
~space up::Gui, Hide

As a possibly better alternative, you could make Win+Space a hotkey to hide/show the keyboard by adding the following line right above K_ShowHide:
#Space::
k_ShowHide: ; << This line is already present.
(but you should remove the ~space hotkeys if you use the above method)

Assistive Tech
  • Guests
  • Last active:
  • Joined: --
No. Actually reverse. So the keyboard keys switch position. i.e. F switches to J and G to H.

Assistive Tech