Sunday, December 28, 2014

Free one handed keyboard script

This is not an Aching Dreams/Cartoon Pornography post. This is not an ad either, this is just a free one handed keyboard script for anyone on the interwebs that needs it. I post this on my blog in the hopes that someone that's looking for this will come across it on google.

Do you need to work on your computer with one hand? Are you tired of having to shift your right hand from mouse to keyboard, to keyboard to mouse, over and over? Do you have at *least* a moderately sized hand, or smaller-than-normal keyboard if you have a small hand? Do you suck at scripting in autohotkey or have utterly no idea what that is? Well, I've got the perfect program for YOU! (sorry, I'll quit it out)

This script is just an advanced form of the one made by "jonny", which you can find here:
http://www.autohotkey.com/board/topic/1257-half-qwerty-one-handed-typing/
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.
My refinement to jonny's original script is that you can now input all keys (with the exception of f1-f12) on the keyboard by using the Win key and Spacebar key. Furthermore, Win+C will now temporarily suspend the script altogether so that you can type with two hands at no hindrance.

How to install:
Download this program (here) and run it every time you want to use it OR simply use autohotkey and paste in the code in the first and second comment in this post.

How to use:
Spacebar and
QWERT=YUIOP
Y= / (so adding shift will press "?")
ASDFGH=H J K L ; '
ZXCVBN= B N M , . /
Tab= Backspace
Capslock= Enter

Left Windows Button and
Q [
E ]
WSAD Up/Down/Left/Right keys
RTY   Ins Home PgUp
FGH   Del End PgDw
Z -
X =
C (special, read below)
V \

Special
Pressing F3 temporarily turns the script off, because using this script while typing with two hands is going to screw you up when you press spacebar. By default, the temporary suspension lasts for 5 minutes.
Pressing Win+C will modify how long the suspension lasts, depending on how many times you press it:
Once 33 seconds
Twice 100 seconds
Thrice 15 mins
Foce(sp) 45 mins
Fivice(sp)  2 hours 15 mins
Sikceh(sp) Resets the counter to 1. Err... if you need this off for more than two hours, you should just close the program.
Pressing F3 after pressing Win+C will invoke the newly modified suspension. If you want the program to tell you how many times you've pressed Win+C, find yourself a handsome man/beautiful woman/dazzling unicorn and record them counting 1 to 5, and place each iteration into your C:\Windows\Media directory as 1.wav, 2.wav and so on. No, you can't have my arethraFranklin1.wav

If you are learning how to use this, I recommend either going to typeracer.com (a typing game against other opponents but sadly they will never know how OP your actual two hand typing skills are), or Typing of the Dead Overkill.

This script/program is released freely. I am not responsible for any damage to your computer and/or child support. No donations are sought, but if you really wanted to thank me, uhhh, if you like cartoon porn, check out my game, otherwise just pay it forward.

20 comments:

  1. #SingleInstance force
    myCounter = 0
    mirror_1 = 6
    mirror_2 = 7
    mirror_3 = 8
    mirror_4 = 9
    mirror_5 = 0
    mirror_q = y
    mirror_w = u
    mirror_e = i
    mirror_r = o
    mirror_t = p
    mirror_a = h
    mirror_s = j
    mirror_d = k
    mirror_f = l
    mirror_g = SC027
    mirror_z = b
    mirror_x = n
    mirror_c = m
    mirror_v = ,
    mirror_b = .
    mirror_6 = -
    mirror_7 = =
    mirror_8 = 3
    mirror_9 = 4
    mirror_0 = 5
    mirror_y = /
    mirror_u = w
    mirror_i = e
    mirror_o = r
    mirror_p = t
    mirror_h = '
    mirror_j = s
    mirror_k = d
    mirror_l = f
    mirror_n = /
    mirror_m = \
    return
    Space & CapsLock::Send {Enter}
    Space & Tab::Send {Backspace}
    +CapsLock::
    CapsLock::
    if CapsState = D
    {
    CapsState = U
    Send {LShift Up}
    }
    else
    {
    CapsState = D
    Send {LShift Down}
    }
    return
    Shift::CapsState = U
    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::

    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


    Lwin::return
    LWin & q::
    GetKeyState, ShiftState, LShift, P
    If ShiftState = D
    {
    SendInput {{}
    return
    }
    If ShiftState = U
    {
    SendInput {[}
    return
    }
    return

    LWin & e::
    GetKeyState, ShiftState, LShift, P
    If ShiftState = D
    {
    SendInput {}}
    return
    }
    If ShiftState = U
    {
    SendInput {SC01B}
    return
    }
    return

    LWin & w::send {up}
    LWin & s::send {down}
    LWin & a::send {left}
    LWin & d::send {right}
    LWin & y::send {PgUp}
    LWin & r::send {Ins}
    LWin & f::send {Delete}
    LWin & t::send {Home}
    LWin & g::send {End}
    LWin & h::send {PgDn}
    LWin & z::
    GetKeyState, ShiftState, LShift, P
    If ShiftState = D
    {
    SendInput {_}
    return
    }
    If ShiftState = U
    {
    SendInput {-}
    return
    }
    return

    LWin & x::
    GetKeyState, ShiftState, LShift, P
    If ShiftState = D
    {
    SendInput {+}
    return
    }
    If ShiftState = U
    {
    SendInput {=}
    return
    }
    return




    LWin & v::
    GetKeyState, ShiftState, LShift, P
    If ShiftState = D
    {
    SendInput {|}
    return
    }
    If ShiftState = U
    {
    SendInput {\}
    return
    }
    return

    ReplyDelete


  2. LWin & c::
    myCounter += 1
    SetTimer, tellMeMyCounter, 300
    if myCounter = 6
    {
    myCounter = 1
    }
    return

    tellMeMyCounter:
    SetTimer, tellMeMyCounter, Off
    if myCounter = 1
    {
    SoundPlay, %A_WinDir%\Media\1.wav
    }
    if myCounter = 2
    {
    SoundPlay, %A_WinDir%\Media\2.wav
    }
    if myCounter = 3
    {
    SoundPlay, %A_WinDir%\Media\3.wav
    }
    if myCounter = 4
    {
    SoundPlay, %A_WinDir%\Media\4.wav
    }
    if myCounter = 5
    {
    SoundPlay, %A_WinDir%\Media\5.wav
    }
    return




    F3::
    Suspend
    if myCounter = 2
    {
    SetTimer, Hotkeys_Off, 33333
    }
    if myCounter = 3
    {
    SetTimer, Hotkeys_Off, 100000
    }
    if myCounter = 4
    {
    SetTimer, Hotkeys_Off, 900000
    }
    if myCounter = 5
    {
    SetTimer, Hotkeys_Off, 2700000
    }
    if myCounter = 1
    {
    SetTimer, Hotkeys_Off, 300000
    }
    return


    Hotkeys_Off:
    Suspend, Off
    SoundBeep
    SetTimer, Hotkeys_Off, Off
    myCounter = 0
    return

    ReplyDelete
  3. 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

    ReplyDelete
  4. https://www.youtube.com/watch?v=MH7KYmGnj40
    He's dead Jim

    ReplyDelete
    Replies
    1. Yep, is it too much to ask for just one blog post/update saying he's still alive?

      Delete
    2. He replied on the post before this one since that one was more crowded with angry complaints. But, you don't need to worry I can assure you he's alive I talk to him every chance I can get on skype when he's not working which if you want you could do too. Honestly if more fans talked to him some understanding could be reached.

      Delete
    3. Well even so, he should still give us an update. Even a short paragraph will keep the fans satisfied, since its a bit unsettling that the last update was last year. Or if he has any problems he can just write on this blog like he used to and we will see if we can give any advice to help :)

      Delete
    4. He will when he can I'm sure just need some time to show anything of import I won't go into details without his permission but there is a very good reason he can't show anything even though he is working on it all the time

      Delete
    5. I'm not asking for him to show anything. I think what Anon 1&2 are saying is, it would be more reassuring if he took literally 2 minutes of his day per week or even two weeks to just type 3 sentences about anything. Doesn't even have to be game related. It would at least be better than what we're getting right now.

      Delete
    6. Yeah, exactly. Just knowing he's alive is a morale booster.

      Delete
  5. I'm alive.

    If you can recall from the latest trailer, there's a battle scene. The battle scene was simulated in a sense that a lot of the code wasn't actually there, and I was just moving things manually by hand. I'm not saying it was all fake; not at all. I mean there's a map system for your perusal a few posts back that I made myself. But I didn't have nearly enough programming experience to be able to tinker with the actual current engine we have and show simulated gameplay through that real engine.

    So I've been programming and you probably already knew that. If you're wondering what's taking so long, well, I wasn't even supposed to be doing all this coding in the first place. My programmer partner was. Yeah, I don't want to blame the guy, but frankly, I'm kind of tired of taking all of the blame for the past few months, especially when you consider that my side of things is very well nearly done. Those story and art assets would be done, except I decided that the best course of action was to assist in programming first, to make his job easier and faster.

    But this shit's not easy. I jumped straight into this code and I still don't know what the hell I'm doing sometimes. I'm learning as I go. I've made sacrifices along the way that I'd rather not express in detail. As for the blog, I haven't been reading these comments despite getting email notifications that they're there. I just couldn't bring myself to read 'em. Sorry.

    All this new coding responsibility that I've had dumped on my lap is some serious "princess is in another castle" bullshit. But Mario doesn't go home. He says "okay you fucking piece of stool, how many castles does Bowser have left?". And you may be wondering why I don't just remove features from the game to make it easier to program, or get it finished already... but I'm not going to dumb down the game. The latest trailer is the target experience I want to provide, and that target is a promise I intend to keep. I just need time.

    Thank you for your patience.

    ReplyDelete
    Replies
    1. Thank you for the update. It means a lot to hear from you every now and again!

      Delete
  6. Glad to hear that you're alive and things are moving forwards no matter the pace. Just take all the time you need to make this game something you can be proud of. We can wait and be patient.

    ReplyDelete
  7. So glad that you are around. Ahh well that would explain a lot. Just be sure the sacrifices that you made/are making are not anything too personal or social and I am sure you will be fine :) We all are rooting for ya!

    ReplyDelete
  8. Oh god man I can't wait any longer.

    ReplyDelete
  9. You should fire your programmer partner.

    ReplyDelete
  10. We reeeeeeally need another update.

    ReplyDelete