AutoHotkey Community

It is currently May 27th, 2012, 1:06 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: RSI and the Pinky Finger
PostPosted: January 6th, 2010, 10:21 pm 
Offline

Joined: December 18th, 2009, 8:45 pm
Posts: 3
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2010, 10:32 pm 
Offline

Joined: September 28th, 2007, 3:56 am
Posts: 279
Location: New York
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 10:17 am 
Offline

Joined: November 8th, 2009, 2:46 am
Posts: 234
Location: Canberra Oz
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 1:48 pm 
Offline

Joined: September 28th, 2007, 3:56 am
Posts: 279
Location: New York
well there you go, I learned something new too.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 5:48 pm 
Offline

Joined: December 18th, 2009, 8:45 pm
Posts: 3
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   


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, WillTroll and 26 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