jordanal Posted October 16, 2006 Report Posted October 16, 2006 Hi Pete, FYI, FSUIPC4 and WideFS7 seem to be running great here. Nice job and congrats on another successful launch. I know you're busy but I'm a bit stumped. Since installing FSUIPC4, I've decided to refine my FSUIPC.ini file and button (control) assignemnts for my CH Throttle Quad & Yoke. I've decided that I need more buttons so I've been attempting to use a keyboard-key as a compound modifier to existing button assignment. I spent most of last evening trying various syntax's (and reading the advanced user's guide) but nothing so far seems to work. I'd prefer a key to do this as I'm out of real buttons available to assign at the moment. For example pressing j2,b0 is Heading_inc and j2,b1 is Heading_dec. I want to hold down the keyboard "control" key for example, while using these same buttons and have its assignement shift to Heading_inc_fast and Heading_dec_fast respectivly. My first attempt (below) seemed logical at first but didn't make a difference when the control key was held down. Although the guide specifically stated that you could mix keys and controls, I didn't see this type combination exampled anywhere. [buttons] 24=R2,0,C65879,0 ;Heading_Inc 25=R2,1,C65880,0 ;Heading_Dec 26=CR(+K0,10)2,0,1024,0 ;Heading_Inc_Fast 27=CR(+K0,10)2,1,1025,0 ;Heading_Dec_Fast Then it seemed that maybe a virtual button set by my keyboard control key. Then the virtual button and its flag status could be used to compound the real buttons. But my first shot at this last night didn't seem to work either. Found this in the guide: 1003 Set button flag (param = 256*joy + btn) 1004 Clear button flag (ditto) So I tried it with an imaginary (virtual) joystck 10, button 1 and programmed it something like: [buttons] 24=R2,0,C65879,0 ;Heading_Inc 25=R2,1,C65880,0 ;Heading_Dec 26=CR(F+10,1)2,0,1024,0 ;Heading_Inc_Fast 27=CR(F+10,1)2,1,1025,0 ;Heading_Dec_Fast [Keys] 0=0,10,1003,2561,1004,2561 I don't know if this is even feasable (to use key-press to compound a button) but I always appreciate your mentoring. AL Jordan
Pete Dowson Posted October 16, 2006 Report Posted October 16, 2006 [buttons] 24=R2,0,C65879,0 ;Heading_Inc 25=R2,1,C65880,0 ;Heading_Dec 26=CR(+K0,10)2,0,1024,0 ;Heading_Inc_Fast 27=CR(+K0,10)2,1,1025,0 ;Heading_Dec_Fast Where does this "+K" condition come from. there's nothing in the docs like that. The button scanner doesn't scan the keyboard too, they are separate facilities. [buttons]24=R2,0,C65879,0 ;Heading_Inc 25=R2,1,C65880,0 ;Heading_Dec 26=CR(F+10,1)2,0,1024,0 ;Heading_Inc_Fast 27=CR(F+10,1)2,1,1025,0 ;Heading_Dec_Fast [Keys] 0=0,10,1003,2561,1004,2561 Well, closer. But there are several problems there: First the button 2,0 will operate your line 24 whether control is held or not, AND line 26 when the Flag is set. Simlarly for 2,1. You need conditions on those too to stop that: 24=CR(F-10,1)2,0,C65879,0 ;Heading_Inc 25=CR(F-10,1)2,1,C65880,0 ;Heading_Dec Next, in the lines 26=CR(F+10,1)2,0,1024,0 ;Heading_Inc_Fast 27=CR(F+10,1)2,1,1025,0 ;Heading_Dec_Fast you need the 'C' still before the control number, thus: 26=CR(F+10,1)2,0,C1024,0 ;Heading_Inc_Fast 27=CR(F+10,1)2,1,C1025,0 ;Heading_Dec_Fast Finally, and this is mainly my fault for not thinking through what I documented: 0=0,10,1003,2561,1004,2561 won't work because, although 0 (null) is listed as a valid code, this is only for key values being sent to FS (from a button push). It's my error for not spotting that the same table is used both for Buttons converting to Keys to be pressed and for Keys being detected. There are some additional KeyCodes which can be used. I'll need to add these to the table: 16 Shift 17 Control 18 Menu Now you still need the shift codes to match, because what will happen is that FSUIPC sees the shift so sets the shift code, ready for matching, then checks both the keycode and shift code against your list of Keys. Thus, to use Shift you need 16,9 Control you need 17,10 Menu you need 18,72 So, if you have: [buttons] 24=CR(F-10,1)2,0,C65879,0 ;Heading_Inc 25=CR(F-10,1)2,1,C65880,0 ;Heading_Dec 26=CR(F+10,1)2,0,C1024,0 ;Heading_Inc_Fast 27=CR(F+10,1)2,1,C1025,0 ;Heading_Dec_Fast [Keys] 0=17,10,1003,2561,1004,2561 then it should all work as you wanted! Regards Pete
jordanal Posted October 16, 2006 Author Report Posted October 16, 2006 Thank you Sir! That makes perfect sense! How come I didn't think of that! LOL :idea: I can't believe I was even close with the flag and virtual butoon theory. I can't wait to get home from work and try this. I'll let you know either way. Regard, Al Jordan
jordanal Posted October 16, 2006 Author Report Posted October 16, 2006 Thanks Pete. Just as you recommended, it worked like a champ. You 'da man ! :D
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now