Schwinn Posted July 18, 2009 Share Posted July 18, 2009 If it's ok with people, I think I'll just be a leech for now -- clinging to someone's thread. Progress will be limited to funds which is something I don't have a lot of, so if I started a thread, it could be weeks or months before I posted an update. It kinda didn't sound right when I went back and reread what I typed. Either way I am happy to see some more home grown collectives and controls =) Link to comment Share on other sites More sharing options...
Ruahatu Posted July 24, 2009 Author Share Posted July 24, 2009 Hello, I found 2 old joystick at home and i dismont them :D. I make some test with switch and SVMAPPER and all work fine (Thanks TH69 :thumbup:) On the second card i have 2 microstick that i will use for the spot and the weapons selection. To program them i use a AUTOHOTKEY script but the conbination of Ctrl and other key don't work :mad: Here is my script, can someone help me :helpsmilie: ; July 6, 2005: Added auto-detection of joystick number. ; May 8, 2005 : Fixed: JoyAxes is no longer queried as a means of ; detecting whether the joystick is connected. Some joysticks are ; gamepads and don't have even a single axis. ; If you want to unconditionally use a specific joystick number, change ; the following value from 0 to the number of the joystick (1-32). ; A value of 0 causes the joystick number to be auto-detected: JoystickNumber = 0 ; END OF CONFIG SECTION. Do not make changes below this point unless ; you wish to alter the basic functionality of the 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. GetKeyState, JoyZ, JoyZ ; Get position of Z axis. GetKeyState, JoyR, JoyR ; Get position of R axis. KeyToHoldDownPrev = %KeyToHoldDown% ; Prev now holds the key that was down before (if any). if JoyX > 70 KeyToHoldDown = i else if JoyX < 30 KeyToHoldDown = y else if JoyY > 70 KeyToHoldDown = u else if JoyY < 30 KeyToHoldDown = {LCtrl}u else if JoyZ > 70 KeyToHoldDown = {RCtrl}{:} else if JoyZ < 30 KeyToHoldDown = {RCtrl}{m} else if JoyR > 70 KeyToHoldDown = {RCtrl}{!} else if JoyR < 30 KeyToHoldDown = {RCtrl}{;} else KeyToHoldDown = if KeyToHoldDown = %KeyToHoldDownPrev% ; The correct key is already down (or no key is needed). 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 Link to comment Share on other sites More sharing options...
Oakes Posted July 24, 2009 Share Posted July 24, 2009 Hi I'm not quite sure what you are trying to do, but {LCtrl}u will send the following: LCtrl down LCtrl up u down u up i.e. first you press and release the CTRL button and then you press and release the u button. I think that you want to send LCtrl + u at the same time. ^u will do this. or {LCtrl down}u{LCtrl up} will also work. /brds Oakes Link to comment Share on other sites More sharing options...
Ruahatu Posted July 24, 2009 Author Share Posted July 24, 2009 Hi Oakes, :mad::(:mad: Don't work. Oakes, what i want to do is to use my 2 microjoystick (axis) like the 2 hatswitch from the collectif. The first to control de weapon (air-air, all, ...) The second to control the spot light. With my script i have a problem with command witch LCtrl or RCtrl + another key. For exemple to select AIR-AIR i have to pusch LCtrl + U. I use your exemple but it always dont work. I beleave that you use to a microjoystick. How have you configure it in BS. Maybe can you give this part of your script :music_whistling: Thanks Link to comment Share on other sites More sharing options...
Recommended Posts