AutoHotkey Community

It is currently May 27th, 2012, 10:33 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: March 3rd, 2010, 3:36 pm 
How do i turn or reset a key back to the original value ?

In the above example :

\::click;

whatever i tried, i could not toggle it on/off with the caps lock key
as used in the above scripts.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 4:58 pm 
Offline

Joined: November 28th, 2009, 4:45 am
Posts: 3089
Modified code I had lying around not tested
Code:
$/::
If GetKeyState("CapsLock","T")
Send {LButton}
else
Send /
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 5:38 pm 
thx none !!

works fine !


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 16th, 2010, 10:22 am 
Hi guys! is there any way that we can get the keyboard to simulate the mouse buttons?


Report this post
Top
  
Reply with quote  
 Post subject: Using with Girder
PostPosted: August 9th, 2010, 11:52 pm 
Offline

Joined: August 9th, 2010, 11:45 pm
Posts: 4
Hi,

thanks for this nice script.


I have a problem. I use this script on my HTPC that I control with my Infrared Remote winlirc and Girder. So girder is the program that emulates the key input to the different programs.

The skripts from ahklerner work fine if I push the hotkeys manually on the attached keyboard. But they don't work if the same hotkeys come from Girder.

Girder is setup to send the keys to the current active window (thats standard in Girder config). I can control all my HTPC Programs that way with my IR Remote.

How can I make these scripts work with Girder?


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 30th, 2011, 9:32 pm 
Offline

Joined: February 27th, 2011, 8:44 pm
Posts: 4
ahklerner wrote:
Code:
SetBatchLines -1
#UseHook
Increment = 1 ; number of pixels to move mouse....gets multiplied depending on keypress length
MouseDelay = 0

w::
a::
s::
d::
xVal=
yVal=
If GetKeyState("CapsLock","T")
   {
      IncrementValue := Increment ; Set the Increment value (we change it)
      ; Infinite loop....breaks when key not pressed anymore
      Loop,
      {
      If (A_Index > IncrementValue * 15) and (IncrementValue < Increment * 5) ; Increase the Increment value depending on how long we held down the key
         IncrementValue := IncrementValue * 2
      If GetKeyState("s", "P")
         yVal := IncrementValue
      Else If GetKeyState("w", "P")
         yVal := -IncrementValue
      If !yVal
         yVal := 0
      If GetKeyState("a", "P")
         xVal := -IncrementValue
      Else If GetKeyState("d", "P")
         xVal := IncrementValue
      If !xVal
         xVal := 0
      If GetKeyState(A_ThisHotKey, "P") ; Make sure we are still pressing the key
         MouseMove, %xVal%, %yVal%,%MouseDelay%,R
      Else ; we're not pressing the key...break the loop
         Break
      }
   }
Else
   Send % "{" . A_ThisHotKey . "}"
return

Esc::ExitApp


I have been able to adapt ahklerner's code to use WASD instead of arrow keys. When using the keyboard the WASD control of the mouse works as expected. But when I try to use a program called xpadder to relay keystrokes from a USB game controller the code fails to run as expected. I ran the code in SciTE using debug mode and found that when it tries to GetKeyState it does not perceive the keys as having been pressed. I presume xpadder keystrokes would be called logical, as opposed to physical keystrokes from the keyboard. I have tried running GetKeyState without the mode option which is supposed to allow it to discern logical keystrokes but it does not work. The previous poster "Rocket" seems to have the same problem with logical keystrokes coming from the program Girder, and the poster "mnahkusr" has the same problem with logical keystrokes coming from the program Input Director in this post.

Can anyone please advise how to adapt this code to work with logical key strokes? Using KeyWait seems like it could almost work, but doesn't exactly parallel the act of retrieving a keys current state the way that GetKeyState does. Sorry if this matter has already been covered. Thank you for whatever assistance you can provide.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 7th, 2011, 1:21 pm 
ahklerner wrote:
there is also a numpad mouse script (forum or help....don't remember)that would be even better for you.
:roll:


Report this post
Top
  
Reply with quote  
 Post subject: :P ...... i aint happy
PostPosted: January 16th, 2012, 3:02 am 
:evil: dis aint helpin!!!!!!!!!!!!!!!!!!!!!!!!!!!


Report this post
Top
  
Reply with quote  
PostPosted: January 16th, 2012, 3:06 am 
isnt dis supposed to say how to???? im in a stick situation!!!!!!!!! :| :x :shock: :? :shock:


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, chaosad, robotkoer, specter333, Yahoo [Bot] and 76 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