AutoHotkey Community

It is currently May 27th, 2012, 7:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 164 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next
Author Message
PostPosted: November 16th, 2004, 4:13 am 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 16th, 2004, 1:51 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Looks great. Might be especially useful for players of flight sims who want to type messages without crashing the plane :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 16th, 2004, 2:04 pm 
Offline

Joined: October 21st, 2004, 3:37 pm
Posts: 5
Location: Fort Bragg, NC
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 16th, 2004, 6:48 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
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)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2004, 7:27 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2004, 5:11 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
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)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: This is So Cool
PostPosted: December 28th, 2004, 12:44 am 
Offline

Joined: December 28th, 2004, 12:33 am
Posts: 60
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 28th, 2004, 11:11 am 
Offline

Joined: December 28th, 2004, 12:33 am
Posts: 60
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 28th, 2004, 6:32 pm 
Offline

Joined: December 28th, 2004, 12:33 am
Posts: 60
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.

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 28th, 2004, 11:32 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
Thanks for sharing, Watcher! I'll give it a go.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: one hand typing solved!
PostPosted: December 29th, 2004, 7:19 am 
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.


Report this post
Top
  
Reply with quote  
PostPosted: December 30th, 2004, 7:16 am 
Offline

Joined: December 28th, 2004, 12:33 am
Posts: 60
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Addition feature request
PostPosted: March 31st, 2005, 3:25 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2005, 7:53 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Reverse
PostPosted: March 31st, 2005, 8:36 pm 
No. Actually reverse. So the keyboard keys switch position. i.e. F switches to J and G to H.

Assistive Tech


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 164 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: nothing and 9 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group