January 28, 20215 yr Is there a way of adjusting the time delay for the repeat function? By that I mean the time that must elapse when a button is pressed and held for that to trigger the repeat function.
January 29, 20215 yr The button handling is event driven and then addressed 10 times a second (10Hz) for the repeat. This is buried deep in the events.lua and handlers-hid.lua code. It is not something I would recommended tampering with. Andrew Gransden Scotland, UK LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew
January 29, 20215 yr Author Ah. I see. Reason I asked is that there seems to be such a short time period between "press" and "repeat". Often I get a repeat no matter how fast I press/release a button. I was hoping to somehow adjust the interval between the "press" and the "repeat". Doesn't seem adjustable from what you've said. Owell, thanks for getting back to me! ~Masterius
February 7, 20215 yr Author Thought I'd give an example as to why I was asking this, and see if there is an alternative. In this example: Pressing switch 3 "flips" the start switch toggle for engine 3 to on. It stays on until the engine starts, at which point it automatically flips back off. However, if the engine doesn't start within 30 seconds, the starter needs to be manually flipped off in order to prevent engine and/or starter damage. As there isn't a "start switch" toggle function, the only ways to do this seems to be: 1) manually mouse-click the starter switch to toggle it, 2) write a lua script with a toggle-type function, or 3) set the "On Press" as on and "On Repeat" as off. While (1) will definitely work, doing so rather negates the point of button-assigning the start switch. (2) is certainly doable; I've written many lua scripts and this one would be quite easy, just tedious as one would be necessary for each engine starter, and mesh, switch, for a total of 8. (3) is my current setup, and it works quite handily...mostly. Sometimes, even the most lightning-fast button press results in the "On Repeat" function being triggered. Even a 300 millisecond delay, I think, would prevent that from happening. Is there an alternative to the three I've already mentioned?
February 8, 20215 yr This example is not the best way to achieve what you are after. The 'mesh switch off' should be assigned to the OnRelease action. The OnRepeat should be blank. Pressing the button would then start the action and releasing it would cancel it. OnRepeat is where you need to continue with the same action (eg. braking) is required for a certain time period. Andrew Gransden Scotland, UK LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew
February 8, 20215 yr Author 8 hours ago, ScotFlieger said: This example is not the best way to achieve what you are after. The 'mesh switch off' should be assigned to the OnRelease action. The OnRepeat should be blank. Pressing the button would then start the action and releasing it would cancel it. OnRepeat is where you need to continue with the same action (eg. braking) is required for a certain time period. Andrew, In the sim, the switches work as latch switches. For example, when the start switch is flipped from neutral (off) to start (on), the switch stays on until the engine starts, at which point the switch return to the neutral (off) position. The mesh switch works the same way. In real life, the switch stays on upon "OnRelease", and only returns to neutral/off when the engine starts or it is manually turned back off. There are no latching switches in my flight sim equipment. There are either momentary on switches (like on my throttle quadrants) or toggle switches (like on my flight switch panel). So to simulate how a latching switch functions in real life, I need an "OnPress" command to turn it on, and a separate "OnPress" command to turn it off. Normally I'd simply use one of the toggle switches for that. However, the starter and mesh switches for the B-17 are rather unique. For example, the starter switch is a three-position switch; it is the starter switch for engine one and also for engine two. To start engine one, the switch is flipped down, and it stays down until the engine starts (or it is manually flipped off), whereupon it then returns to the middle, off position. To start engine two, it is flipped up, and it stays up until the engine starts (or it is manually flipped off), whereupon it then returns to the middle, off position. I've programmed the throttle quadrant momentary switches to emulate the B-17 starter and mesh switches. Push the switch down (OnPress) and it turns the starter switch on; releasing the switch (OnRelease) does nothing, as the starter switch needs to remain on. Push the switch up (OnPress), and it turns the other engine start switch on; releasing the switch (OnRelease) does nothing, as again the other starter switch needs to remain on. However, if the engine does not start and the starter switch needs to be turned off... Using the "OnRepeat" was a fudge. Ideally, a "Long Press" would work better: a quick press to turn it on, and a long press to turn it off. I've recently run across ways of writing short and long press functions, and I'll see what I can do with those. ~Al
February 9, 20215 yr It is not possible to 'latch' the physical button/switch on your device. I don't think LINDA is able to replicate what you are trying to do. As you say, you were trying to fudge it. If the start switch returns to off once the engine starts you only need to use the OnPress function. If the switch must be held on until the engine catches then the OnRepeat should work. Unfortunately, holding the OnRepeat too long will fill the buffer with OnRepeat functions. A special function may need to be written and assigned to OnPress. This function would loop (for a limited number of cycles) testing the state of the engine start and calling the 'On' function each time. A problem with this technique would be that it would prevent any other function being called until the OnPress function finishes. Andrew Gransden Scotland, UK LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew
Archived
This topic is now archived and is closed to further replies.