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 

Half-QWERTY: One-handed Typing
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
jonny



Joined: 13 Nov 2004
Posts: 2952
Location: Minnesota

PostPosted: Tue Nov 16, 2004 3:13 am    Post subject: Half-QWERTY: One-handed Typing Reply with quote

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.

Code:
; 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
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10667

PostPosted: Tue Nov 16, 2004 12:51 pm    Post subject: Reply with quote

Looks great. Might be especially useful for players of flight sims who want to type messages without crashing the plane Smile
Back to top
View user's profile Send private message Send e-mail
cr33p



Joined: 21 Oct 2004
Posts: 5
Location: Fort Bragg, NC

PostPosted: Tue Nov 16, 2004 1:04 pm    Post subject: Reply with quote

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.de/one-hand/one-hand.html - cause that's just pretty sexy.
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 2952
Location: Minnesota

PostPosted: Tue Nov 16, 2004 5:48 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Nov 17, 2004 6:27 am    Post subject: Reply with quote

jonny wrote:
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.thumbscript.com/howitworks.html
Back to top
jonny



Joined: 13 Nov 2004
Posts: 2952
Location: Minnesota

PostPosted: Wed Nov 17, 2004 4:11 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
Watcher



Joined: 27 Dec 2004
Posts: 60

PostPosted: Mon Dec 27, 2004 11:44 pm    Post subject: This is So Cool Reply with quote

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!
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Watcher



Joined: 27 Dec 2004
Posts: 60

PostPosted: Tue Dec 28, 2004 10:11 am    Post subject: Reply with quote

I'm working on this part of your code:

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:

Code:

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?
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Watcher



Joined: 27 Dec 2004
Posts: 60

PostPosted: Tue Dec 28, 2004 5:32 pm    Post subject: Reply with quote

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. Shocked Here is the final version of the script.

Code:

; 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
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
jonny



Joined: 13 Nov 2004
Posts: 2952
Location: Minnesota

PostPosted: Tue Dec 28, 2004 10:32 pm    Post subject: Reply with quote

Thanks for sharing, Watcher! I'll give it a go.
Back to top
View user's profile Send private message
vorchatwo
Guest





PostPosted: Wed Dec 29, 2004 6:19 am    Post subject: one hand typing solved! Reply with quote

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.
Back to top
Watcher



Joined: 27 Dec 2004
Posts: 60

PostPosted: Thu Dec 30, 2004 6:16 am    Post subject: Re: one hand typing solved! Reply with quote

vorchatwo wrote:
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.

vorchatwo wrote:
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?
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Assistive Tech
Guest





PostPosted: Thu Mar 31, 2005 2:25 pm    Post subject: Addition feature request Reply with quote

I was wondering if you could insert a onscreen keyboard that reflects the key-layout while the spacebar was pressed?

i.e. http://www.autohotkey.com/docs/scripts/KeyboardOnScreen.htm

Thanks,

Assistive Tech
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10667

PostPosted: Thu Mar 31, 2005 6:53 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message Send e-mail
Assistive Tech
Guest





PostPosted: Thu Mar 31, 2005 7:36 pm    Post subject: Reverse Reply with quote

No. Actually reverse. So the keyboard keys switch position. i.e. F switches to J and G to H.

Assistive Tech
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 1 of 9

 
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