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 

RSI and the Pinky Finger

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
sporkit



Joined: 18 Dec 2009
Posts: 3

PostPosted: Wed Jan 06, 2010 9:21 pm    Post subject: RSI and the Pinky Finger Reply with quote

Good afternoon gentlemen!

I've been a web developer and server administrator for the past several years and recently begun to suffer from repetitive strain injury. Specifically I'm beginning to have trouble with my pinky fingers. I spend most of my day programming in a shell prompt and hammering away with Vi and GNU Screen.

In these programs there's a lot of ctrl this and that which is finally taking it's toll on my little finger. I'm trying to put together a set of tools to help myself and anyone else who might be experiencing the same problems. What I have so far is below.

Code:

; disable left control entirely
Lctrl:: MsgBox Left control disabled!  Save the pinkies!

; enforce using shift on the opposite end of the kb when typing a letter
<+q::
<+w::
<+e::
<+r::
<+t::
<+a::
<+s::
<+d::
<+f::
<+g::
<+z::
<+x::
<+c::
<+v::
<+b::
<+1::
<+2::
<+3::
<+4::
<+5::
<+6::
MsgBox Your using the wrong shift button!  Save the pinkies!


I'm having trouble with the following bit of code. I'd like to press f and , to trigger GNU Screen jumps. The code below works, but now the f key wont type anything. I assume it's waiting for the rest of the key combination. Could anybody help me with a solution to this?

Code:

; pressing f and , sends ctrl+a+n or ctrl+a+p to jump around screen sessions
f & ,::Send ^ap
f & .::Send ^an
Back to top
View user's profile Send private message
ribbs2521



Joined: 28 Sep 2007
Posts: 273
Location: New York

PostPosted: Wed Jan 06, 2010 9:32 pm    Post subject: Reply with quote

interesting, now, when you press f and , are you going to be holding the f and pressing , or is it a sequential where it's f (up/down) then , (up/down)?

If it's f hold and , you could do something like
Code:

f::
  Loop
  {
    if (GetKeyState(","))
      Send, ^ap
    else if (GetKeyState("."))
      Send, ^an
    if (!GetKeyState("f"))
      Break
  }
  return


I think something like that would work. It may need some work, I didn't test it but I think it's a start.

What it should do is while you are holding f you should be able to press . and , to move through pages and then it should stop once you release f. Only problem I see with this is what if you just want to send f hmmmm. Nobody said I had all of the answers... or any for that matter.
Back to top
View user's profile Send private message
Michael@Oz



Joined: 08 Nov 2009
Posts: 233
Location: Canberra Oz

PostPosted: Thu Jan 07, 2010 9:17 am    Post subject: Reply with quote

From Help
Quote:
You can define a custom combination of two keys (except joystick buttons) by using " & " between them. In the below example, you would hold down Numpad0 then press the second key to trigger the hotkey:

Numpad0 & Numpad1::MsgBox You pressed Numpad1 while holding down Numpad0.
Numpad0 & Numpad2::Run NotepadIn the above example, Numpad0 becomes a prefix key; but this also causes Numpad0 to lose its original/native function when it is pressed by itself. To avoid this, a script may configure Numpad0 to perform a new action such as one of the following:

Numpad0::WinMaximize A ; Maximize the active/foreground window.
Numpad0::Send {Numpad0} ; Make the release of Numpad0 produce a Numpad0 keystroke. See comment below.The presence of one of the above hotkeys causes the release of Numpad0 to perform the indicated action, but only if you did not press any other keys while Numpad0 was being held down.


Looks like you may need a
Code:
$f::Send f
Back to top
View user's profile Send private message
ribbs2521



Joined: 28 Sep 2007
Posts: 273
Location: New York

PostPosted: Thu Jan 07, 2010 12:48 pm    Post subject: Reply with quote

well there you go, I learned something new too.
Back to top
View user's profile Send private message
sporkit



Joined: 18 Dec 2009
Posts: 3

PostPosted: Thu Jan 07, 2010 4:48 pm    Post subject: Reply with quote

Michael@oz wrote:
From Help

Looks like you may need a
Code:
$f::Send f


Thanks Michael. I lifted my code right from that section too. I should have noticed that.

After playing around a bit more yesterday, it became apparent that i'ts probably more convenient to be using special key combinations anyway. Although this code should come in handy in the future. Here's what I have so far if anybody is interested.

Code:

;
; Save the Pinkies!!!
;

; Enfroce proper keyboard usage

Lctrl:: MsgBox Left control disabled!  Save the pinkies!
return

<+q::
<+w::
<+e::
<+r::
<+t::
<+a::
<+s::
<+d::
<+f::
<+g::
<+z::
<+x::
<+c::
<+v::
<+b::
<+1::
<+2::
<+3::
<+4::
<+5::
<+6::
MsgBox Your using the wrong shift button!  Save the pinkies!
return

; GNU Screen

!s::Send ^an      ; jump to the next screen
!a::Send ^ap      ; jump to previous screen
!d::Send ^ac      ; create new window

; VIM

!q::Send {Esc}:q{!}{Enter}   ; save and quit out vi
!w::Send {Esc}:w{!}{Enter}   ; save and quit out vi

; Dexpot

Numpad1::Send !1      ; jump to screen 1
Numpad2::Send !2      ; jump to screen 2
Numpad3::Send !3      ; jump to screen 3
Numpad4::Send !4      ; jump to screen 4

Numpad5::Send #+5      ; copy cur window to all screen

Numpad0 & Numpad1::Send #1   ; move cur window to screen 1
Numpad0 & Numpad2::Send #2   ; move cur window to screen 2
Numpad0 & Numpad3::Send #3   ; move cur window to screen 3
Numpad0 & Numpad4::Send #4   ; move cur window to screen 4

; Old Junk
         ;  to save my pinky finger :(
;LCtrl::return      ;  disable left control
;LShift::return      ;  disable left shift
;Capslock::LShift   ;  attempt to use other finger

;+Capslock::Capslock
;Capslock::Ctrl

;  This switches alt and ctrl
;   LCtrl::Alt
;   LAlt::Ctrl

;LCtrl::{Alt Down}
;LCtrl Up::{Alt Up}

;LAlt::Send {Ctrl Down}
;LAlt Up::
;Sleep 50
;Send {Ctrl Up}
;Return   
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
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