krimson
11-28-2005, 08:10 PM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Party Poker Keyboard Shortcuts
;
; Distributed the Online Poker FAQ
; See http://www.onlinepokerfaq.com/guide/mouseless-poker.html
;
; Based on an original script by "illunious" at 2+2, posted 8/18/2004.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Define keys for fold, check/call, and bet/raise
;
; The key for each action is defined by the string before the double colon.
; You can change the key like this:
; Regular keys: a, b, c, 1, 2, 3, etc.
; Function keys: F1, F2, etc.
; Numeric keypad: Numpad1, Numpad2, NumpadPlus, etc
; Arrows keys: Left, Right, Up, Down
; Control key prefix: add caret in front, like this: ^f, ^c, ^r
; Alt key prefix: add exclamantion point in front: !f, !c, !r
; Windows key prefix: add hash mark in front: #f, #c, #r
; Using a Joystick as a Mouse
; http://www.autohotkey.com
; This script converts a joystick into a three-button mouse. It allows each
; button to drag just like a mouse button and it uses virtually no CPU time.
; Also, it will move the cursor faster depending on how far you push the joystick
; from center. You can personalize various settings at the top of the script.
; Increase the following value to make the mouse cursor move faster:
JoyMultiplier = 0.30
; Decrease the following value to require less joystick displacement-from-center
; to start moving the mouse. However, you may need to calibrate your joystick
; -- ensuring it's properly centered -- to avoid cursor drift. A perfectly tight
; and centered joystick could use a value of 1:
JoyThreshold = 2.5
; Change these values to use joystick button numbers other than 1, 2, and 3 for
; the left, right, and middle mouse buttons, respectively:
ButtonLeft = 2
ButtonRight = 12
; If your joystick has a POV control, you can use it as a mouse wheel. The
; following value is the number of milliseconds between turns of the wheel.
; Decrease it to have the wheel turn faster:
WheelDelay = 250
; If your system has more than one joystick, increase this value to use a joystick
; other than the first:
JoystickNumber = 1
; END OF CONFIG SECTION -- Don't change anything below this point unless you want
; to alter the basic nature of the script.
; this is to suspend the hotkeys, so you can type normally/browse web/etc
; note: ! = alt, ^ = ctrl.. so !t = alt+t
#SingleInstance
Hotkey, %JoystickNumber%Joy%ButtonLeft%, ButtonLeft
Hotkey, %JoystickNumber%Joy%ButtonRight%, ButtonRight
; Calculate the axis displacements that are needed to start moving the cursor:
JoyThresholdUpper = 50
JoyThresholdUpper += %JoyThreshold%
JoyThresholdLower = 50
JoyThresholdLower -= %JoyThreshold%
SetTimer, WatchJoystick, 10 ; Monitor the movement of the joystick.
GetKeyState, JoyInfo, %JoystickNumber%JoyInfo
IfInString, JoyInfo, P ; Joystick has POV control, so use it as a mouse wheel.
SetTimer, MouseWheel, %WheelDelay%
!t::
Suspend, Toggle
return ; End of auto-execute section.
; Fold
Joy1::
;MouseClick, left, 240, 474
;Sleep, 100
MouseClick, left, 240, 474
Sleep, 100
return
; Check/Call
Joy4::
;MouseClick, left, 385, 474
;Sleep, 100
MouseClick, left, 385, 474
Sleep, 100
return
; Bet/Raise
Joy3::
;MouseClick, left, 550, 474
;Sleep, 100
MouseClick, left, 550, 474
Sleep, 100
return
; AutoPost
Joy9::
MouseClick, left, 14, 533
Sleep, 100
return
; SitOut
Joy10::
MouseClick, left, 14, 568
Sleep, 100
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Define keys for absolute mouse motion to a particular window.
; For example, "Numpad7" always goes to the upper-left window.
; This does not depend on where the mouse starts.
; WindowNW
Joy7::
CoordMode, Mouse, Screen
MouseMove,400,300
MouseGetPos, curPosX, curPosY, curWin
WinGetTitle, title, ahk_id %curWin%
WinActivate, %title%
return
; WindowNE
Joy8::
CoordMode, Mouse, Screen
MouseMove,1200,300
MouseGetPos, curPosX, curPosY, curWin
WinGetTitle, title, ahk_id %curWin%
WinActivate, %title%
return
; WindowSW
Joy5::
CoordMode, Mouse, Screen
MouseMove,400,900
MouseGetPos, curPosX, curPosY, curWin
WinGetTitle, title, ahk_id %curWin%
WinActivate, %title%
return
; WindowSE
Joy6::
CoordMode, Mouse, Screen
MouseMove,1200,900
MouseGetPos, curPosX, curPosY, curWin
WinGetTitle, title, ahk_id %curWin%
WinActivate, %title%
return
; Return
Joy11::
Send {enter}
return
; The subroutines below do not use KeyWait because that would sometimes trap the
; WatchJoystick quasi-thread beneath the wait-for-button-up thread, which would
; effectively prevent mouse-dragging with the joystick.
ButtonLeft:
SetMouseDelay, -1 ; Makes movement smoother.
MouseClick, left,,, 1, 0, D ; Hold down the left mouse button.
SetTimer, WaitForLeftButtonUp, 10
return
ButtonRight:
SetMouseDelay, -1 ; Makes movement smoother.
MouseClick, right,,, 1, 0, D ; Hold down the right mouse button.
SetTimer, WaitForRightButtonUp, 10
return
WaitForLeftButtonUp:
GetKeyState, JoyStateLeft, %JoystickNumber%Joy%ButtonLeft%
if JoyStateLeft = D ; The button is still, down, so keep waiting.
return
; Otherwise, the button has been released.
SetTimer, WaitForLeftButtonUp, off
SetMouseDelay, -1 ; Makes movement smoother.
MouseClick, left,,, 1, 0, U ; Release the mouse button.
return
WaitForRightButtonUp:
GetKeyState, JoyStateRight, %JoystickNumber%Joy%ButtonRight%
if JoyStateRight = D ; The button is still, down, so keep waiting.
return
; Otherwise, the button has been released.
SetTimer, WaitForRightButtonUp, off
MouseClick, right,,, 1, 0, U ; Release the mouse button.
return
WatchJoystick:
MoveMouse? = n ; Set default.
SetFormat, float, 03
GetKeyState, joyx, %JoystickNumber%JoyX
GetKeyState, joyy, %JoystickNumber%JoyY
if joyx > %JoyThresholdUpper%
{
MoveMouse? = y
DeltaX = %joyx%
DeltaX -= %JoyThresholdUpper%
}
else if joyx < %JoyThresholdLower%
{
MoveMouse? = y
DeltaX = %joyx%
DeltaX -= %JoyThresholdLower%
}
else
DeltaX = 0
if joyy > %JoyThresholdUpper%
{
MoveMouse? = y
DeltaY = %joyy%
DeltaY -= %JoyThresholdUpper%
}
else if joyy < %JoyThresholdLower%
{
MoveMouse? = y
DeltaY = %joyy%
DeltaY -= %JoyThresholdLower%
}
else
DeltaY = 0
if MoveMouse? = y
{
DeltaX *= %JoyMultiplier%
DeltaY *= %JoyMultiplier%
SetMouseDelay, -1 ; Makes movement smoother.
MouseMove, %DeltaX%, %DeltaY%, 0, R
}
return
MouseWheel:
GetKeyState, JoyPOV, %JoystickNumber%JoyPOV
if JoyPOV = -1 ; No angle.
return
if (JoyPOV > 31500 or JoyPOV < 4500) ; Forward
Send {WheelUp}
else if JoyPOV between 13500 and 22500 ; Back
Send {WheelDown}
return
DavidC
11-29-2005, 05:00 AM
I'm definitely going to take a peek through what you guys have written here, but I'll put up my trip report so far:
Here's what I've found: I've glanced through the PDF referenced in the thread that I linked to. They're talking about scripts written with a program called "autohotkey", which are customized to party poker, and they certainly do their job.
There are other programs out there that you could use to convert your keyboard into the same purpose as a game controller... and I suppose that you could continuously switch up between scripts, going from mouse to keyboard to controller and back, in order to reduce stress on your body. This is ideal, and it's similar to what graphic artists do.
Here's what I did, though:
------------------------------------
1) I wanted to be able to use my controller as a mouse in all situations, so that I could use it with any software. I didn't have to multitable all the time with it. Therefore I went out and got joymouse (link) (http://www.vp-soft.com/software/joymouse.php). This program is shareware for 30 days.
I bookmarked all the other programs, just in case I wanted a more permanent, customized, and powerful solution later.
2) When I set up joymouse, you go down to performance and configure "pointer speed" to your desired sensitivity. If you want to make it capable of more subtle movements, I believe that you need to change the "pointer increment law" from linear to quadratic or cubic, which would probably give you some sensitivity in near regions to the center of the joystick, but fast movement in far regions... I haven't played around with that. I set my pointer speed to 1500, fwiw.
3) Just for fun I also tried to set up my joymouse to run ALT-TAB for me, but found that it was unable to specify LEFT TAB, and therefore it didn't work. /images/graemlins/frown.gif
---
I've found that this program works fine for running a single program where there are two buttons to press and they're close together. This is probably not ideal for what you guys are trying to do, but it's fast, and it does its job for me, for now.
I'm not particularly looking forward to the day when I'm doing more multitabling and have to start using more complicated programs to get my job done. However, I'm content that the info is out there and easily available.
Thanks guys.
I hope you don't mind me posting up this alternative.
--Dave.
Nomad84
11-29-2005, 05:09 PM
I just wanted say thanks for the link in the OP. I've been searching 2+2 for controller related scripts, but I never found that one. It is EXACTLY what I was needing, since I am trying to use my xbox controller to play poker. I had no idea how to script it myself, so having a starting point is awesome. Thanks to CMI and Qtip for writing those. I think I'll use a hybrid of them. I'll probably modify it to use the A, B, X, and Y buttons to select the tables (hold left trigger to choose the same on second monitor), start to check/uncheck autopost, d-pad to choose actions (check/fold, call, raise), and probably the black button to fold. I like having the joystick as a mouse too. I'll probably use the joystick click button for a mouseclick. I may post whatever I end up with, but I expect it to take some time to get it all right. Thanks again for the link. I was clueless about where to start.
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.