Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 02-10-2006, 04:33 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: A script you might like

Need help, very confused now... (and got AHK tilt now!!! hehe) [img]/images/graemlins/smile.gif[/img]

I just tried to get this working with a joypad, but I seem to be doing something wrong [img]/images/graemlins/confused.gif[/img]

I can use the joypad buttons just fine and have adapted your script to do this, but I can't seem to get the D-Pad to control the active window.

I run of out ideas now, the script bellow seems to be capable of sending cursor keys fine (ie: it will move around icons on my desktop, or move the cursor in notepad, etc), BUT it just wont send these keys to the other script (they work in parallel somehow, so I can use the keyboard cursors keys to move the active window, and STILL use the D-pad to send up/down/left/right etc) :

;_________________________________________________

;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <[email protected]>
;
; Script Function:
; Template AutoHotkey script.
;
#Persistent ; Keep this script running until the user explicitly exits it.
SetTimer, WatchAxis, 5
return

WatchAxis:
GetKeyState, JoyX, JoyX ; Get position of X axis.
GetKeyState, JoyY, JoyY ; Get position of Y axis.
KeyToHoldDownPrev = %KeyToHoldDown% ; Prev now holds the key that was down before (if any).

if JoyX > 70
KeyToHoldDown = right
else if JoyX < 30
KeyToHoldDown = left
else if JoyY > 70
KeyToHoldDown = down
else if JoyY < 30
KeyToHoldDown = up
else
KeyToHoldDown =

if KeyToHoldDown = %KeyToHoldDownPrev% ; The correct key is already down.
return ; Do nothing.

; Otherwise, release the previous key and press down the new key:
SetKeyDelay -1 ; Avoid delays between keystrokes.
if KeyToHoldDownPrev ; There is a previous key to release.
Send, {%KeyToHoldDownPrev% up} ; Release it.
if KeyToHoldDown ; There is a key to press down.
Send, {%KeyToHoldDown% down} ; Press it down.
return

;_________________________________________________

I did originally try to merge this script with yours and write it all using functions, but had no luck getting it to work either... [img]/images/graemlins/frown.gif[/img]

I not used AHK much (tend to code stuff up using win32 calls) or use another macro-er called MacroSceduler (which is nothing like as good, but lets u write VB functions to get round its limitations).

It must be something I am doing which is really silly, but I just can't seem to work out what the heck I am doing wrong. Any help would be very much appreciated [img]/images/graemlins/smile.gif[/img]

Juk [img]/images/graemlins/smile.gif[/img]
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.