Yuriks Posted December 27, 2021 Posted December 27, 2021 Is there a way to initiate an action by a press of a keyboard button?
Rudel_chw Posted December 27, 2021 Posted December 27, 2021 (edited) Yes, if that keyboard key corresponds to an aircraft control or switch. You use this trigger action: X:START LISTEN COMMAND – start listening for the specified input command to set the specified flag to on. COMMAND – sets the value of the command to listen to. The command value can be obtained in the Game Options>Controls screen by hovering the mouse over the command description (left side of the screen). This functionality can be enabled in Mission Editor/Mission Editor.lua by changing the “OPTIONS_ADD_COMMAND_CODES_TO_TOOLTIP” line from “false” to “true”. FLAG - sets the flag number to set to on when the specified event occurs. HIT COUNT – sets the number of times the command must be entered before the specified flag is set to on. VAL LIM MIN – sets the minimum value of the command input. VAL LIM MAX – sets the maximum value of the command input. COCKPIT DEVICE – cockpit system ID numb PD: This trigger is meant for single player missions only, does not work in multiplayer Edit: Here is a sample from one of my missions, where this trigger action is used to detect when the user presses the "\" key (to call up the Communications Menu): when the player presses \ at least one time, the flag 102 becames TRUE and that enables the next trigger on the sequence. This type of key (the Comm Menu key, the Active Pause, etc, correspond to Cockpit Device 0. Most commands dont make use of value limits. Edited December 27, 2021 by Rudel_chw 3 2 For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
HiCKS-BB15 Posted October 6, 2022 Posted October 6, 2022 On 12/27/2021 at 3:45 AM, Rudel_chw said: COMMAND – sets the value of the command to listen to. The command value can be obtained in the Game Options>Controls screen by hovering the mouse over the command description (left side of the screen). This functionality can be enabled in Mission Editor/Mission Editor.lua by changing the “OPTIONS_ADD_COMMAND_CODES_TO_TOOLTIP” line from “false” to “true”. Expand Thank you so much for this tip !!! Helpfull 1
YoYo Posted October 12, 2023 Posted October 12, 2023 (edited) On 12/27/2021 at 3:45 AM, Rudel_chw said: Yes, if that keyboard key corresponds to an aircraft control or switch. You use this trigger action: X:START LISTEN COMMAND – start listening for the specified input command to set the specified flag to on. COMMAND – sets the value of the command to listen to. The command value can be obtained in the Game Options>Controls screen by hovering the mouse over the command description (left side of the screen). This functionality can be enabled in Mission Editor/Mission Editor.lua by changing the “OPTIONS_ADD_COMMAND_CODES_TO_TOOLTIP” line from “false” to “true”. FLAG - sets the flag number to set to on when the specified event occurs. HIT COUNT – sets the number of times the command must be entered before the specified flag is set to on. VAL LIM MIN – sets the minimum value of the command input. VAL LIM MAX – sets the maximum value of the command input. COCKPIT DEVICE – cockpit system ID numb PD: This trigger is meant for single player missions only, does not work in multiplayer Edit: Here is a sample from one of my missions, where this trigger action is used to detect when the user presses the "\" key (to call up the Communications Menu): when the player presses \ at least one time, the flag 102 becames TRUE and that enables the next trigger on the sequence. This type of key (the Comm Menu key, the Active Pause, etc, correspond to Cockpit Device 0. Most commands dont make use of value limits. Expand Hello, Id like to use simple trigger - open a cargo doors in Mi-24 (rear doors). The problem is that it isnt click spot here (just shortcut for this) so I cant use argument option. I found this option X:START LISTEN COMMAND and number of keys 3022 and 3023 for that doors (open/close) but it doesnt work for me (I put this in Command, set the flag, rest is the same like on your screenshot). Any idea where the problem could be? Edited October 12, 2023 by YoYo Webmaster of http://www.yoyosims.pl Win 10 64, i9-13900 KF, RTX 4090 24Gb OC, RAM 64Gb Corsair Vengeance LED OC@3600MHz,, 3xSSD+3xSSD M.2 NVMe, Predator XB271HU res.2560x1440 27'' G-sync, Sound Blaster Z + 5.1, TiR5, [MSFS, P3Dv5, DCS, RoF, Condor2, IL-2 CoD/BoX] VR fly only: Meta Quest Pro
Rudel_chw Posted October 12, 2023 Posted October 12, 2023 On 10/12/2023 at 8:26 AM, YoYo said: I found this option X:START LISTEN COMMAND and number of keys 3022 and 3023 for that doors (open/close) but it doesnt work for me (I put this in Command, set the flag, rest is the same like on your screenshot). Any idea where the problem could be? Expand Just tried those commands (3022 & 3023) and they do work for me ... here is a sample mission where you can check how it works. The hardest door to open is the copilot... because you have to perform the command when sat on his seat, so I use the command 1602 to change seats. The sim startts with the player on the pilot seat, so the first 1602 is used to move over to the copilot seat, then the action to open his door, the next 1602 moves you to the gunner's seat, and the final 1602 moves you back to the pilot seat. Fortunately, the three commands work so fast that you don't see the change in seating, just the doors opening Mi-24P - Test Doors (by Rudel_chw).mizFetching info... 1 For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
YoYo Posted October 12, 2023 Posted October 12, 2023 Wow, you surprised me with your solution and immediate example! Great, thank you very much, I'll test it when I get home. Thanks to this, I will also understand this mechanism better. 1 Webmaster of http://www.yoyosims.pl Win 10 64, i9-13900 KF, RTX 4090 24Gb OC, RAM 64Gb Corsair Vengeance LED OC@3600MHz,, 3xSSD+3xSSD M.2 NVMe, Predator XB271HU res.2560x1440 27'' G-sync, Sound Blaster Z + 5.1, TiR5, [MSFS, P3Dv5, DCS, RoF, Condor2, IL-2 CoD/BoX] VR fly only: Meta Quest Pro
YoYo Posted October 12, 2023 Posted October 12, 2023 On 10/12/2023 at 11:45 AM, Rudel_chw said: Just tried those commands (3022 & 3023) and they do work for me ... Expand Ok, I checked, your set up works, however I was thinking about not automatic process but using X:START LISTEN COMMAND < so when user do someting (short keys in this situation like LShift+RCtrl+C) and doors will be open manually he fire up the trigger. So not as automatic process. If I understand it correctly, this command is for listening to key combinations for and specific function. Here is my example. Btw. I see in your config you have Cocpit device = 11. So maybe I should add this too? TY! Webmaster of http://www.yoyosims.pl Win 10 64, i9-13900 KF, RTX 4090 24Gb OC, RAM 64Gb Corsair Vengeance LED OC@3600MHz,, 3xSSD+3xSSD M.2 NVMe, Predator XB271HU res.2560x1440 27'' G-sync, Sound Blaster Z + 5.1, TiR5, [MSFS, P3Dv5, DCS, RoF, Condor2, IL-2 CoD/BoX] VR fly only: Meta Quest Pro
Rudel_chw Posted October 12, 2023 Posted October 12, 2023 (edited) On 10/12/2023 at 4:52 PM, YoYo said: Ok, I checked, your set up works, however I was thinking about not automatic process but using X:START LISTEN COMMAND Expand Sorry, I misunderstood what you needed On 10/12/2023 at 4:52 PM, YoYo said: see in your config you have Cocpit device = 11. So maybe I should add this too? TY! Expand Yes, correct, you need the device ID, 11 on this case. I updated my demo, now it detects when the pilot opens or closes the cargo doors: The demo is more complex than I would like because the door control is just a single binding for both open and close, making it harder to distinguish between opening or closing the doors. I use a state flag for this: "Left Door Closed" & "Right Door Closed", TRUE when its closed and FALSE when its open. It works assuming that the Doors are closed at Mission Start. I used SWITCHED CONDITION triggers to allow multiple door operations to be detected, it makes the triggers more flexible at the expense of clarity of the logic behind it. here is the updated mission: Mi-24P - Test Doors v2 (by Rudel_chw).mizFetching info... Edited October 12, 2023 by Rudel_chw 1 For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
YoYo Posted October 12, 2023 Posted October 12, 2023 Yes it started to work as it should! ID 11 solved my problem, thanks a lot! 1 Webmaster of http://www.yoyosims.pl Win 10 64, i9-13900 KF, RTX 4090 24Gb OC, RAM 64Gb Corsair Vengeance LED OC@3600MHz,, 3xSSD+3xSSD M.2 NVMe, Predator XB271HU res.2560x1440 27'' G-sync, Sound Blaster Z + 5.1, TiR5, [MSFS, P3Dv5, DCS, RoF, Condor2, IL-2 CoD/BoX] VR fly only: Meta Quest Pro
YoYo Posted October 18, 2023 Posted October 18, 2023 (edited) On 10/12/2023 at 5:56 PM, Rudel_chw said: Yes, correct, .... Expand Quite different question but maybe you have an idea. What can I set up to listen command but ... F1, F2 etc keys (for example radio communications)? For example, for F1 its the "7" but Im not sure about the device (cockpit) and the range min max. For example, in this situation it doesnt work. Edited October 18, 2023 by YoYo Webmaster of http://www.yoyosims.pl Win 10 64, i9-13900 KF, RTX 4090 24Gb OC, RAM 64Gb Corsair Vengeance LED OC@3600MHz,, 3xSSD+3xSSD M.2 NVMe, Predator XB271HU res.2560x1440 27'' G-sync, Sound Blaster Z + 5.1, TiR5, [MSFS, P3Dv5, DCS, RoF, Condor2, IL-2 CoD/BoX] VR fly only: Meta Quest Pro
Rudel_chw Posted October 18, 2023 Posted October 18, 2023 On 10/18/2023 at 9:23 PM, YoYo said: Quite different question but maybe you have an idea. What can I set up to listen command but ... F1, F2 etc keys (for example radio communications)? For example, for F1 its the "7" but Im not sure about the device (cockpit) and the range min max. Expand Here you are getting on really murky ground .. for example the F1 that you show is a View Command, and it is defined on two places: within the aircraft's Controls, and also within the "General" category ... not sure which one the aircraft actually uses ... and the F1 that you use on the Radio Menu is not the same F1, I don't know how to actually detect that binding. Did a quick test and found that I can only have a trigger action perform that cockpit action, but can't detect the case where the user does the same action. On this sample, I use F2 to change the view from within a trigger .. but can't detect the user doing the same. F-15E - Test Capture F keys (by Rudel_chw).mizFetching info... 1 For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
YoYo Posted October 18, 2023 Posted October 18, 2023 Yes, for multi-functional use. Thx, I will try! Webmaster of http://www.yoyosims.pl Win 10 64, i9-13900 KF, RTX 4090 24Gb OC, RAM 64Gb Corsair Vengeance LED OC@3600MHz,, 3xSSD+3xSSD M.2 NVMe, Predator XB271HU res.2560x1440 27'' G-sync, Sound Blaster Z + 5.1, TiR5, [MSFS, P3Dv5, DCS, RoF, Condor2, IL-2 CoD/BoX] VR fly only: Meta Quest Pro
RubberDogSh1tOutOfHKG Posted February 19, 2024 Posted February 19, 2024 On 12/27/2021 at 3:45 AM, Rudel_chw said: Yes, if that keyboard key corresponds to an aircraft control or switch. You use this trigger action: X:START LISTEN COMMAND – start listening for the specified input command to set the specified flag to on. COMMAND – sets the value of the command to listen to. The command value can be obtained in the Game Options>Controls screen by hovering the mouse over the command description (left side of the screen). This functionality can be enabled in Mission Editor/Mission Editor.lua by changing the “OPTIONS_ADD_COMMAND_CODES_TO_TOOLTIP” line from “false” to “true”. FLAG - sets the flag number to set to on when the specified event occurs. HIT COUNT – sets the number of times the command must be entered before the specified flag is set to on. VAL LIM MIN – sets the minimum value of the command input. VAL LIM MAX – sets the maximum value of the command input. COCKPIT DEVICE – cockpit system ID numb PD: This trigger is meant for single player missions only, does not work in multiplayer Edit: Here is a sample from one of my missions, where this trigger action is used to detect when the user presses the "\" key (to call up the Communications Menu): when the player presses \ at least one time, the flag 102 becames TRUE and that enables the next trigger on the sequence. This type of key (the Comm Menu key, the Active Pause, etc, correspond to Cockpit Device 0. Most commands dont make use of value limits. Expand Is there similarly a way to detect a button pressed in the Cockpit?
Rudel_chw Posted February 19, 2024 Posted February 19, 2024 On 2/19/2024 at 10:04 PM, RubberDogSh1tOutOfHKG said: Is there similarly a way to detect a button pressed in the Cockpit? Expand The START LISTEN COMMAND works for all commands, be they binded to a button or to a keyboard key. What button are you thinking about? 1 For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
algherghezghez Posted November 29, 2024 Posted November 29, 2024 Can anyone get the start listen command for the command 1602 (switch seat) work? I would basically like to force the player in the backseat but while the set command 1602 works I can't get the start listening command 1602 to work
Rudel_chw Posted November 29, 2024 Posted November 29, 2024 On 11/29/2024 at 1:51 PM, algherghezghez said: Can anyone get the start listen command for the command 1602 (switch seat) work? Expand what aircraft are you using? For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
Rudel_chw Posted November 29, 2024 Posted November 29, 2024 On 11/29/2024 at 2:42 PM, algherghezghez said: Mb-339 Expand OK, let me check. For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
Rudel_chw Posted November 29, 2024 Posted November 29, 2024 On 11/29/2024 at 2:42 PM, algherghezghez said: Mb-339 Expand It doesn't work for me either. Also, the MB339 has a "SEAT" parameter, but its value is always "0" irrespective if I'm at the from or at the rear cockpit. May I suggest that you report this on the Bugs & Problems section of the MB-339 subforum, so that its developers can take a look? 1 For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
algherghezghez Posted November 29, 2024 Posted November 29, 2024 Thanks a lot Rudel, I was going crazy over this 1
Recommended Posts