 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2183 Location: GERMANY
|
Posted: Fri Nov 20, 2009 12:21 pm Post subject: |
|
|
Here we go
Btw. why did you use 2JOY... | Code: | #Persistent
;ICP
1_18000_DOWN={Shift}{NumpadDiv}
2_18000_UP={Shift}{NumpadMult}
...
Loop 3 ;as many times as many hotkeys
{
Hotkey,2JOY%A_Index% Down,SendDown
Hotkey,2JOY%A_Index% Up,SendUp
SetTimer, WatchPOV, 100
return
WatchPOV:
GetKeyState, POV, 2JoyPOV ; Get position of the POV control.
If POV not in 18000,0,9000
Return
Loop 3 ;as many times as many hotkeys
2JOY%A_Index%_senddown:=%A_Index%_%POV%_DOWN
,2JOY%A_Index%_sendup:=%A_Index%_%POV%_UP
Return
SendDown:
SendInput % %A_ThisHotkey%_senddown
Return
SendUp:
SendInput % %A_ThisHotkey%_sendup
Return
|
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
flyway
Joined: 17 Nov 2009 Posts: 30
|
Posted: Fri Nov 20, 2009 1:25 pm Post subject: |
|
|
Thanks my friend.
2Joy, because this is a 2nd joystick.
I have a cougar and a leo bodnar board and the code if for that board.
Abou that code, will it require all buttons to have "_DOWN" and "_UP" definitions ?
Because I only need DOWN and UP for the button 26, all other buttons can work just the way other code was...
Thanks again. |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2183 Location: GERMANY
|
Posted: Fri Nov 20, 2009 1:40 pm Post subject: |
|
|
| flyway wrote: | Thanks my friend.
2Joy, because this is a 2nd joystick.
I have a cougar and a leo bodnar board and the code if for that board.
Abou that code, will it require all buttons to have "_DOWN" and "_UP" definitions ?
Because I only need DOWN and UP for the button 26, all other buttons can work just the way other code was...
Thanks again. |
It should be no problem to mix those, just use Hotkey,..., Send for the others and add a subroutine send. _________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
flyway
Joined: 17 Nov 2009 Posts: 30
|
Posted: Fri Nov 20, 2009 2:20 pm Post subject: |
|
|
Did you mean this..?
| Code: |
#Persistent
;ICP
1_18000={Shift}{NumpadDiv}
2_18000={Shift}{NumpadMult}
3_18000={Shift}{Numpad7}
4_18000={Shift}{Numpad9}
5_18000={Shift}{Numpad0}
6_18000={Shift}{NumpadDot}
7_18000={Ctrl}{Numpad1}
8_18000={Ctrl}{Numpad2}
9_18000={Ctrl}{Numpad3}
10_18000={Ctrl}{NumpadDot}
11_18000={Ctrl}{NumpadAdd}
12_18000={Ctrl}{NumpadSub}
13_18000={Ctrl}{Numpad4}
14_18000={Ctrl}{Numpad5}
15_18000={Ctrl}{Numpad6}
16_18000={Ctrl}{NumpadEnter}
17_18000={Ctrl}{Numpad7}
18_18000={Ctrl}{Numpad8}
19_18000={Ctrl}{Delete}
20_18000={Ctrl}{Home}
21_18000={Ctrl}{Numpad9}
22_18000={Ctrl}{Numpad0}
23_18000={Ctrl}{PgDn}
24_18000={Ctrl}{Enter}
25_18000={Shift}{Ctrl}{Alt}W
26_18000_DOWN={Shift}{Ctrl}{Alt}7 ; Drift C/O On
26_18000_UP={Shift}{Ctrl}{Alt}8 ; Drift C/O Off
;MFDleft
1_0={Ctrl}{Alt}1
2_0={Ctrl}{Alt}2
3_0={Ctrl}{Alt}3
;MFDright
1_9000={Shift}1
2_9000={Shift}2
3_9000={Shift}3
Loop 26 ;as many times as many hotkeys
Hotkey,2JOY%A_Index%,Send
SetTimer, WatchPOV, 100
return
Loop 26 ;as many times as many hotkeys
Hotkey,2JOY%A_Index% Down,SendDown
,Hotkey,2JOY%A_Index% Up,SendUp
SetTimer, WatchPOV, 100
return
WatchPOV:
GetKeyState, POV, 2JoyPOV ; Get position of the POV control.
If POV not in 18000,0,9000
Return
Loop 26 ;as many times as many hotkeys
2JOY%A_Index%_send:=%A_Index%_%POV%
Return
Loop 26 ;as many times as many hotkeys
2JOY%A_Index%_senddown:=%A_Index%_%POV%_DOWN
,2JOY%A_Index%_sendup:=%A_Index%_%POV%_UP
Return
Send:
SendInput % %A_ThisHotkey%_send
Return
SendDown:
SendInput % %A_ThisHotkey%_senddown
Return
SendUp:
SendInput % %A_ThisHotkey%_sendup
Return
|
This works for all buttons except for the 26.
Thou am not sure if the code was correctly appended.
BTW, is that coma correct?
Have added it just like you done few lines below, and braket "{" in same loop was giving error... so removed it.
Thanks. |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2183 Location: GERMANY
|
Posted: Fri Nov 20, 2009 3:31 pm Post subject: |
|
|
Try this: | Code: | #Persistent
;ICP
1_18000=+{NumpadDiv}
2_18000=+{NumpadMult}
3_18000=+{Numpad7}
4_18000=+{Numpad9}
5_18000=+{Numpad0}
6_18000=+{NumpadDot}
7_18000=^{Numpad1}
8_18000=^{Numpad2}
9_18000=^{Numpad3}
10_18000=^{NumpadDot}
11_18000=^{NumpadAdd}
12_18000=^{NumpadSub}
13_18000=^{Numpad4}
14_18000=^{Numpad5}
15_18000=^{Numpad6}
16_18000=^{NumpadEnter}
17_18000=^{Numpad7}
18_18000=^{Numpad8}
19_18000=^{Delete}
20_18000=^{Home}
21_18000=^{Numpad9}
22_18000=^{Numpad0}
23_18000=^{PgDn}
24_18000=^{Enter}
25_18000=+^!W
26_18000_DOWN=+^!7 ; Drift C/O On
26_18000_UP=+^!8 ; Drift C/O Off
;MFDleft
1_0=^!1
2_0=^!2
3_0=^!3
;MFDright
1_9000=+1
2_9000=+2
3_9000=+3
Loop 25 ;as many times as many hotkeys
Hotkey,2JOY%A_Index%,Send
Hotkey,2JOY26 Down,SendDown
Hotkey,2JOY26 Up,SendUP
SetTimer, WatchPOV, 100
return
WatchPOV:
GetKeyState, POV, 2JoyPOV ; Get position of the POV control.
If POV not in 18000,0,9000
Return
Loop 25 ;as many times as many hotkeys
2JOY%A_Index%_send:=%A_Index%_%POV%
2JOY26_senddown:=2JOY26_%POV%_DOWN
2JOY26_sendup:=2JOY26_%POV%_UP
Return
Send:
SendInput % %A_ThisHotkey%_send
Return
SendDown:
SendInput % %A_ThisHotkey%_senddown
Return
SendUp:
SendInput % %A_ThisHotkey%_sendup
Return |
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
flyway
Joined: 17 Nov 2009 Posts: 30
|
Posted: Fri Nov 20, 2009 4:35 pm Post subject: |
|
|
Hey HKI,
It's giving me error at this line
"Hotkey,2JOY26 Down,SendDown" in the first loop 25.
We're almost there...
Thanks alot. |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2183 Location: GERMANY
|
|
| Back to top |
|
 |
flyway
Joined: 17 Nov 2009 Posts: 30
|
Posted: Fri Nov 20, 2009 5:41 pm Post subject: |
|
|
Maybe you're right.
But how do I change the code... ?
Because, don't believe being enough deleting "Send Down" lines...
Thanks for your quickness, well for all.
Cheers.
PS: the error I mentioned above is as follows;
Error: "2JOY26 Down" is not a valid key name
Last edited by flyway on Fri Nov 20, 2009 5:46 pm; edited 1 time in total |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2183 Location: GERMANY
|
|
| Back to top |
|
 |
flyway
Joined: 17 Nov 2009 Posts: 30
|
Posted: Fri Nov 20, 2009 5:52 pm Post subject: |
|
|
I deleted that word "Down" and then it gives me oanother error and in another line;
Line; SendInput % %A_ThisHotkey%_sendup
Error; The following variable name contains an illegal character "2JOY26 Up_sendup" |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2183 Location: GERMANY
|
Posted: Fri Nov 20, 2009 6:05 pm Post subject: |
|
|
Try this, I changed a few things: | Code: | #Persistent
;ICP
1_18000=+{NumpadDiv}
2_18000=+{NumpadMult}
3_18000=+{Numpad7}
4_18000=+{Numpad9}
5_18000=+{Numpad0}
6_18000=+{NumpadDot}
7_18000=^{Numpad1}
8_18000=^{Numpad2}
9_18000=^{Numpad3}
10_18000=^{NumpadDot}
11_18000=^{NumpadAdd}
12_18000=^{NumpadSub}
13_18000=^{Numpad4}
14_18000=^{Numpad5}
15_18000=^{Numpad6}
16_18000=^{NumpadEnter}
17_18000=^{Numpad7}
18_18000=^{Numpad8}
19_18000=^{Delete}
20_18000=^{Home}
21_18000=^{Numpad9}
22_18000=^{Numpad0}
23_18000=^{PgDn}
24_18000=^{Enter}
25_18000=+^!W
26_18000=+^!7 ; Drift C/O On
26_UP_18000=+^!8 ; Drift C/O Off
;MFDleft
1_0=^!1
2_0=^!2
3_0=^!3
;MFDright
1_9000=+1
2_9000=+2
3_9000=+3
Loop 26 ;as many times as many hotkeys
Hotkey,2JOY%A_Index%,Send
Hotkey,2JOY26 Up,SendUP
SetTimer, WatchPOV, 100
return
WatchPOV:
GetKeyState, POV, 2JoyPOV ; Get position of the POV control.
If POV not in 18000,0,9000
Return
Loop 26 ;as many times as many hotkeys
2JOY%A_Index%_send:=%A_Index%_%POV%
2JOY26_sendup:=2JOY26_UP_%POV%
Return
Send:
SendInput % %A_ThisHotkey%_send
Return
SendUp:
StringReplace,hotkey,A_ThisHotkey,% " ",_
SendInput % %hotkey%_sendup
Return |
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
flyway
Joined: 17 Nov 2009 Posts: 30
|
Posted: Fri Nov 20, 2009 6:12 pm Post subject: |
|
|
Thanks alot mate.
Now there's no errors, but the up keystroke doesn't work for the button 26.
All the rest is working as far as could test. |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2183 Location: GERMANY
|
|
| Back to top |
|
 |
flyway
Joined: 17 Nov 2009 Posts: 30
|
Posted: Fri Nov 20, 2009 6:35 pm Post subject: |
|
|
| HotKeyIt wrote: | | Does 2JOY26 UP work at all? |
Well, that's the only one being a switch instead of a push-button soldered to leo's board. It's at 26st button position.
So, in Games controler can see if activated when pushed to upper position and de-activated when in down position.
With this code it activates the keystroke for the upper position (standard 2Joy26 btn), but does nothing when I pull it down - Key "UP" in the code.
What else I should check?
Thanks. |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2183 Location: GERMANY
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|