Pokey On/Off or On/off/on DX Mappings
-
Are you assigning the one input on Pokeys as a DX switch, not part of a matrix? Then you can indeed use the ‘release’ function in your BMS keyfile to map the correct callback when the switch goes to the off position.
For my laser & master arm switch for example I use this:SimLaserArmOn 161 -2 -2 0 0x0 0 SimLaserArmOff 161 -2 -2 0x42 0x0 0 SimArmMasterArm 162 -2 -2 0 0x0 0 SimSafeMasterArm 162 -2 -2 0x42 0x0 0 SimSafeMasterArm 163 -2 -2 0x42 0x0 0 SimSimMasterArm 163 -2 -2 0 0x0 0
I’m still getting to grips with it, as today’s playing about is the first time I’ve ever used Pokeys. It’s great fun thus far! I can see the various 2 or 3 way switches connected to pins and assigned as digital outputs in the software. So, using a two way (on/off) switch as an example, it is either On (DX1) or Off (nothing; circuit open) so I cannot (directly) assign a button to the off position, so as you say, the 0x42 are what I need.
Not sure what you mean about the matrix… which is the best option?
-
Yes, say your on/off switch is recognised as DX button 100 and want to use it for laser switch, you’ll need this in your keyfile:
SimLaserArmOn 100 -2 -2 0 0x0 0 // callback laser on when DX 100 gets active
SimLaserArmOff 161 -2 -2 0x42 0x0 0 // callback laser off when DX 100 gets inactive againMatrix setup lets you use a lot more switches/knobs/buttons with a lot less wires/ports on the Pokeys as they all share a common row/column (hence the matrix name).
Pokeys supports a 16x8 matrix. So a matrix of max 16 rows and 8 columns, equals 128 positions in total with just 24 wires and Pokeysports (16+8).
As they don’t get recognised as DX input, you’ll need to assign the correct keyboard combo’s within Pokeys for each press/release of each position.
You’ll need additional diodes to get rid of ghosting. More info on matrix keyboards: http://blog.komar.be/how-to-make-a-keyboard-the-matrix/ -
Yes, say your on/off switch is recognised as DX button 100 and want to use it for laser switch, you’ll need this in your keyfile:
SimLaserArmOn 100 -2 -2 0 0x0 0 // callback laser on when DX 100 gets active
SimLaserArmOff 161 -2 -2 0x42 0x0 0 // callback laser off when DX 100 gets inactive againMatrix setup lets you use a lot more switches/knobs/buttons with a lot less wires/ports on the Pokeys as they all share a common row/column (hence the matrix name).
Pokeys supports a 16x8 matrix. So a matrix of max 16 rows and 8 columns, equals 128 positions in total with just 24 wires and Pokeysports (16+8).
As they don’t get recognised as DX input, you’ll need to assign the correct keyboard combo’s within Pokeys for each press/release of each position.
You’ll need additional diodes to get rid of ghosting. More info on matrix keyboards: http://blog.komar.be/how-to-make-a-keyboard-the-matrix/Got you, I think I understand it. For the simplicity of this device, I don’t think matrix would offer me much over the standard Dx way (forgive my poor terminology). Unless I mapped every individual switch position as a DX button I’m not going to run out of buttons. I’ll stick with normal buttons for now (see pics) and edit the keyfile so that BMS detects switch states (or rather, DX on/off). This way I’m not wasting a DX button when falcon can assign a call back to _leaving_button, if that makes sense.
-
yes makes perfect sense. I’m currently also using DX for my center pedestal but will be using matrix for the left & right aux & consoles so I can handle everything with only one pokeys on each side.
-
Are you assigning the one input on Pokeys as a DX switch, not part of a matrix? Then you can indeed use the ‘release’ function in your BMS keyfile to map the correct callback when the switch goes to the off position.
For my laser & master arm switch for example I use this:SimLaserArmOn 161 -2 -2 0 0x0 0 SimLaserArmOff 161 -2 -2 0x42 0x0 0 SimArmMasterArm 162 -2 -2 0 0x0 0 SimSafeMasterArm 162 -2 -2 0x42 0x0 0 SimSafeMasterArm 163 -2 -2 0x42 0x0 0 SimSimMasterArm 163 -2 -2 0 0x0 0
Hi guys.
Really interesting.
I’m trying to figure how to implement release function in order to map only ON positions. I’m looking into my Full.key and notoced, for instance, these values:
SimLaserArmOn 310 0 0X26 2 0 0 1 “MISC: LASER Switch - Toggle”
SimLaserArmOff 310 0 0x26 4 0 0 1 “MISC: Laser Switch - Arm”
Switch On-Off set as trigger in pokeys and only mapped On posit.
So, i’ve read that by changing values in DX code line it should recognize release state (0x42).
I’ll give a try.
Regards
-
Hi guys.
Really interesting.
I’m trying to figure how to implement release function in order to map only ON positions. I’m looking into my Full.key and notoced, for instance, these values:
SimLaserArmOn 310 0 0X26 2 0 0 1 “MISC: LASER Switch - Toggle”
SimLaserArmOff 310 0 0x26 4 0 0 1 “MISC: Laser Switch - Arm”
Switch On-Off set as trigger in pokeys and only mapped On posit.
So, i’ve read that by changing values in DX code line it should recognize release state (0x42).
I’ll give a try.
Regards
Sounds like what you need. Toggles, in my opinion, are only good when literally pressing G km your keyboard for gear etc. Have toggle callbacks on a switch is a bad idea because you don’t ‘preflight’ your hardware switches before you enter the pit, you have some switches backwards compared to the 3D pit.
-
Id stick to DX hazza, Im going that route with mine.
-
Id stick to DX hazza, Im going that route with mine.
Yeah unless I’ve misunderstood, I want to stay WELL clear of keystroke mappings (I must sound like a broken record to Arty and Mower, but IMO keystrokes assigned to buttons just doesn’t work well), especially on switches that will sit in on positions. Knowing me, I’d make a mistake and the switch would be constantly sending out a keystroke etc.
I’m on my own in the office today, so I’m going to have a go at editing my keyfile (will do it manually) to have the state detection implemented
-
Sounds like what you need. Toggles, in my opinion, are only good when literally pressing G km your keyboard for gear etc. Have toggle callbacks on a switch is a bad idea because you don’t ‘preflight’ your hardware switches before you enter the pit, you have some switches backwards compared to the 3D pit.
Mmm… this is something i didn’t thought berore… so if i go for this changes and let’s say i start my mission in air (eg. During a dogfight round) but i forgot to turn on battery switch to main gen, my jet will lose electrical power on main instruments or worse if on OFF all electrical source…
-
Mmm… this is something i didn’t thought berore… so if i go for this changes and let’s say i start my mission in air (eg. During a dogfight round) but i forgot to turn on battery switch to main gen, my jet will lose electrical power on main instruments or worse if on OFF all electrical source…
That’s why I always do a preflight interior check to match my switches to the status I will get in 3D. That’s something mandatory if you start using a simpit imho
-
No, the preflight is done after entering 3D.
The pre-preflight is only mandatory if using toggle callbacks or keyboard commands, IMO.
-
So I’ve added the following under the MISC panel in my key file:
SimRFNorm 128 -2 -2 0 0x0 0 "MISC: RF Switch - NORM" SimRFQuiet 128 -2 -2 0x42 0x0 0 "MISC: RF Switch - QUIET" SimRFQuiet 129 -2 -2 0x42 0x0 0 "MISC: RF Switch - QUIET" SimRFSilent 129 -2 -2 0 0x0 0 "MISC: RF Switch - SILENT"
128 should be button 1 on the 5th device, but it shows up in BMS setup as button 129 (because the BMS counts from 0).
I save it in Notepad++, go back to BMS, but when I press the switch, it just says button 129 No Function Assigned.
What am I messing up?
EDIT: Those lines don’t appear in BMS setup either…
-
Switch the two 129 lines around. Crazy as it seems I had same issue with my ICP and I had to have the “make” line before the “break” line.
-
Switch the two 129 lines around. Crazy as it seems I had same issue with my ICP and I had to have the “make” line before the “break” line.
Thanks, but no joy. Just for laughs I changed the description of an existing entry and that didn’t appear in BMS. It’s like it’s not seeing the same file, but it 100% is. I saved my keyfile as another name in Notepad++ and loaded that in BMS to verify.
Does it matter where it goes? Does it have to go at the bottom of the file if it’s the last device in device sorting.txt etc?
-
It doesn’t matter where the device is in the list, no. The position on the list simply decides which batch of 32 DX button numbers are assigned to it.
Actually, I just thought of something… 128 and 129 would be different devices: 1-32, 33-64, 65-96, 97-128, etc. Mind you, we have to take into account the start at 0, start at 1 thing too. Have a look at theis mate, I wish I could be more help but on the iPad right now and I cannot remember the exact details.
-
It doesn’t matter where the device is in the list, no. The position on the list simply decides which batch of 32 DX button numbers are assigned to it.
Actually, I just thought of something… 128 and 129 would be different devices: 1-32, 33-64, 65-96, 97-128, etc. Mind you, we have to take into account the start at 0, start at 1 thing too. Have a look at theis mate, I wish I could be more help but on the iPad right now and I cannot remember the exact details.
Update. It works, but it’s just not showing the description now. I noticed that BMS in fact wasn’t actually loading my file and I saw a pattern that it doesn’t like large filenames. So, in a huff, I renamed it to BMS - C*NT.key, and it bloody worked!
I fired up the 3D, and my file is sort of working; the 0x42 parts aren’t so I can get either NORM or SILENT, but not QUIET. Also, BMS doesn’t show the description text; I presume that this is because it’s not defined further up the keyfile with a keystroke?
EDIT: I’d swapped the 0 an 0x42 as instructed by Malc, but I mustn’t have saved it into the new shorter named file. Switched them, and now my three way switch works using only two DX buttons!. One switch down, ~16 to go…
-
A related question, and forgive me if it’s in the manual; I don’t recall seeing it mentioned, but I’m reading it again now.
Is it possible, without defaulting to the 0 and 0x42 options, to assign two or more callbacks to a single Dx button? Previously I had it on my Cougar profile itself, but I’m hoping I can just do it all via the keyfile. For example:
# Paddle/S4 (Win DX4 = BMS DX3) SimAPOverride 3 -1 -2 0 0x0 -1 SimWheelBrakes 3 -1 -2 0 0x0 -1
Is this possible?
EDIT: Yes, yes I can. Super blonde moment, I dunno why I didn’t just think to actually try it first…