gr8guitar Posted November 19, 2023 Report Posted November 19, 2023 Hello. FSUIPC allows imaginary buttons to be used, particularly, its flags. For example, joystick 13 and button 0 would be 256x13+0 = 3328 which can be set (C1003), cleared (c100)4 or toggled (C1005). I realize in a lua: ipc.testbuttonflag(j,b) can be used. So for curiosity, since 13 is multiplied by 256, can a person access this as an offset, if so how? I tried logging the 3328 to no avail. Thank you.
John Dowson Posted November 19, 2023 Report Posted November 19, 2023 6 hours ago, gr8guitar said: So for curiosity, since 13 is multiplied by 256, can a person access this as an offset, if so how? I tried logging the 3328 to no avail. Thank you. Yes you can, but not using that offset- see offset 0x29F0 which provides a facility to set/clear/toggle virtual button flags. The flags themselves are stored from offset 0x3340. By writing to offset 0x3328, you will be writing to this: Quote 0x3328 - Elevator Axis input value, post calibration, just before being applied to the simulation (if allowed to by the byte at offset 310A). You should always consult the FSUIPC Offset Status document before reading/writing to offsets. John
gr8guitar Posted November 19, 2023 Author Report Posted November 19, 2023 Hello John. Thank you for your reply and information. You are correct, I should consult the manual. I was unaware that 3328 was already assigned. I started using imaginary joystick 17 (17*256 = 4352) but that did not seem to respond so I assumed I could use any imaginary joystick. Back to my question though, if 4352 is available, is there a way to access its offset (like any other FSUIPC offset)? I tried logging 4352 but saw no changes. The reason I ask is I have a VRInsight GPS-5. VRiSim and SerialFP2 did not work. However, thanks to FSUIPC.ini, I can use [VRInsight] 1=COM5,COM6. This allows buttons that can be assigned. It has a user button. I want to assign the standard GPS buttons to other functions when 280,10 is set.
John Dowson Posted November 19, 2023 Report Posted November 19, 2023 45 minutes ago, gr8guitar said: I tried logging 4352 but saw no changes. I do not understand why you are trying the EXACT same thing as before, but for a different offset. Offset 4532 is in this area: Quote 0x4500 256 Don LaFontaine's FreeFDS (to be confirmed!) You CAN NOT invent an offset for your own use (although you can use offsets marked as 'free for general use' for your own purposes). As I have already said, virtual joystick button states are held in offsets 0x3340: Quote 0x3340 36 This area is used for externally signaled “joystick button” control, a set of 288 "virtual buttons". Each DWORD or 32 bits represents one “joystick” with 32 buttons. If an external program sets or clears a bit in any of these 9 DWORDS the “Buttons” page in FSUIPC will register the change as a button operation on one of Joystick numbers 64 to 72 (corresponding to the 9 DWORDs). So, FSUIPC can be used to program whatever actions the user wants. See also offset 29F0 Please read and understand that. Also note that it only holds space for 9 joysticks, 32 buttons each. You cannot use (imaginary) joystick 17, that is not supported. 57 minutes ago, gr8guitar said: I want to assign the standard GPS buttons to other functions when 280,10 is set. Not sure what this means ('280,10''?), but if you want to have different functions in a button depending on the state if another button, use compound button controls - see the Advanced User guide for details. John
gr8guitar Posted November 19, 2023 Author Report Posted November 19, 2023 Hello John. 1) I am not talking about the virtual buttons for use with WideFS ( x3340 = P64,0 --> etc.). I am talking about the buttons that are generated when, within FSUIPC.ini: [VRInsight] 1=COM5,COM6. In this case, the buttons are: joystick 280, buttons=x (j280,bx). The user button is j280,b10. This is from FSUIPC4 for Advanced Users. j280,0, etc. are real buttons on the VRInsight GPS-5. 2) As far as flags for buttons, I got the information from the FSUIPC4 for Advanced Users, around page 19 or 20 (on one computer, it is page 19, on another, it's page 20). And it states, in part: This controls a facility to make FSUIPC perform one-off actions when FS is first loaded and running (i.e. actually ready to fly). This is by programming a real or imaginary Button. Simply add the line “InitialButton=j,b” to the [Buttons] section. The values of j (0–255) and b (0–31) can specify a real joystick and button, or a non-existent one, it doesn’t matter. Real ones can have an action assigned on-line, in the Buttons option page, but multiple actions for any button, real or not, can be accomplished by editing the INI file as described here. page 25 or 26: (for example, Joystick 15, Button 31 would be 3871). This says execute Control 1005 whenever your button is pressed. Control 1005 is "Button Flag Toggle". The parameter '3842' identifies the Flag: 256 x joystick 15 + button. I have used these imaginary joystick flags extensively with no issues... until today. The below didn't work: 1190=P280,10,C1005,3328 ; toggle j13,b0 -{: Joy 13 Button 0}- 1192=P280,10,CM6:0,0 ; set GPSWPTStatus -{Macro UserButtonSet}- 1194=CP(F+13,0)280,11,Cx010066DC,x01 ; if 3328 is set=>66DC=1 -{offset byte set, offset 66DC}- 1196=CP(F+13,0)280,10,Cx010066DC,x00 ; if 3328 is set=>66DC=0 -{offset byte set, offset 66DC}- 1198=CP(F+13,0)280,10,CM6:1,0 ; clr GPSWPTStatus --{Macro UserButtonCleared}- So I was interested in seeing the status of 3328 as an offset. In any case, I was able to get what I need by: 1190=P280,10,C1005,3584 ; toggle 14,0 -{: Joy 14 Button 0}- 1192=CP(F+14,0)280,10,Cx010066DC,x01 -{offset byte set, offset 66DC}- 1194=CP(F-14,0)280,10,Cx010066DC,x00 -{offset byte set, offset 66DC}- !1=; 1196=B66DC=1 P280,11,Cx010066DD,x01 ; PREV -{offset byte set, offset 66DD}- 1198=B66DC=1 P280,12,Cx010066DD,x02 ; NEXT -{offset byte set, offset 66DD}- You see, the old GPS500 (FS9,FSX) didn't allow to add/delete waypoints in the flight plan. A person, Dave Dibbel (sp?), modified the xml so it could. I am now adapting that ability to the GPS-5.
John Dowson Posted November 20, 2023 Report Posted November 20, 2023 15 hours ago, gr8guitar said: 1) I am not talking about the virtual buttons for use with WideFS ( x3340 = P64,0 --> etc.). I am talking about the buttons that are generated when, within FSUIPC.ini: [VRInsight] 1=COM5,COM6. In this case, the buttons are: joystick 280, buttons=x (j280,bx). The user button is j280,b10. This is from FSUIPC4 for Advanced Users. j280,0, etc. are real buttons on the VRInsight GPS-5. But your initial post said 'FSUIPC allows imaginary buttons to be used,...' and also 'I started using imaginary joystick 17' so I assumed that you were talking about virtual buttons. And also note that only joysticks 0-15 are supported, not 17. 15 hours ago, gr8guitar said: This controls a facility to make FSUIPC perform one-off actions when FS is first loaded and running (i.e. actually ready to fly). This is by programming a real or imaginary Button. Simply add the line “InitialButton=j,b” to the [Buttons] section. The values of j (0–255) and b (0–31) can specify a real joystick and button, or a non-existent one, it doesn’t matter. Real ones can have an action assigned on-line, in the Buttons option page, but multiple actions for any button, real or not, can be accomplished by editing the INI file as described here. Yes, that is for the InitialButton directive. Also page numbers are fixed. If you are seeing different page numbers on different PCs, then you are looking at different versions of the document. 15 hours ago, gr8guitar said: page 25 or 26: (for example, Joystick 15, Button 31 would be 3871). This says execute Control 1005 whenever your button is pressed. Control 1005 is "Button Flag Toggle". The parameter '3842' identifies the Flag: 256 x joystick 15 + button. Yes - these are parameters for controls, and nothing to do with offsets. Just because the parameter to control a button flag is 3871, that does not mean that offset 3871 is available to control the same button flag. Do not confuse parameters with offsets. Of course, a parameter CAN be an offset address, but only if/when stated. 15 hours ago, gr8guitar said: So I was interested in seeing the status of 3328 as an offset No! You were interested in seeing the status of the button flag for joystick 13, button 0. 3328 just happens to be the parameter used when you want to toggle/set/clear the flag for this button. It has nothing to do with offsets. The state of button flags are generally not held in offsets. 16 hours ago, gr8guitar said: The below didn't work: 1190=P280,10,C1005,3328 ; toggle j13,b0 -{: Joy 13 Button 0}- 1192=P280,10,CM6:0,0 ; set GPSWPTStatus -{Macro UserButtonSet}- 1194=CP(F+13,0)280,11,Cx010066DC,x01 ; if 3328 is set=>66DC=1 -{offset byte set, offset 66DC}- 1196=CP(F+13,0)280,10,Cx010066DC,x00 ; if 3328 is set=>66DC=0 -{offset byte set, offset 66DC}- 1198=CP(F+13,0)280,10,CM6:1,0 ; clr GPSWPTStatus --{Macro UserButtonCleared}- Well, if that was your issue you should have posted that earlier. Looks like at least that 2nd 'F+13' should be 'F-13', similar to the second working assignments, where you have also changed to use joystick 14 for some reason. But if its now working, no point in revisiting the assignments that are working. You should be able to see the difference between the two and figure out why it wasn't previously working...
gr8guitar Posted November 24, 2023 Author Report Posted November 24, 2023 hmmm.... I don't know what happened to my earlier post. It appears to have been removed for some reason. To get back to my original inquiry. Yes, I am asking to know if there is a way to know the status of the flags of the buttons (real or imaginary)? Since the flags' status have to be stored in some kind of memory address, I was wondering if there was access to it, i.e.: as an offset- type. If that is not possible, no big deal, I just assign an unused offset (like above) and then I know...
John Dowson Posted November 24, 2023 Report Posted November 24, 2023 6 hours ago, gr8guitar said: I am asking to know if there is a way to know the status of the flags of the buttons (real or imaginary)? Since the flags' status have to be stored in some kind of memory address, I was wondering if there was access to it, i.e.: as an offset- type. As I said, no - it is not possible to read the status of a button flag from an offset. There is a "hot button" facility, where you can register to detect joystick button presses (see offset 0x2910), but not to read the status of a button flag. These are kept in internal data structures.
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