This are the Support Forums for FSUIPC and related products.
These forums replace the old support forums which have been running for 20+ years. The old forums contain a wealth of information on all FSUIPC products, but are now no longer available.
Please note that you will need to Register and Login to post for support, and also to download attachments. You can view these forums without registering.
Support is also available via Discord. Please use the following invite link to join the FSUIPC Discord server:
https://discord.gg/zjwUTrxmmE
lua event-based fast/slow button generator for rotary switches
https://raw.githubusercontent.com/bbuhlig/fsuipc-contrib/main/rotfsev.lua
The above is what I wrote to manage slow vs. fast rotation of the inc/dec and trim wheel on my Honeycomb Bravo. While not perfect, it's the best I've been able to manage so far given the apparent inability of these rotaries to detect button presses faster than ~95ms.
This module monitors a set of rotary switches for fast vs. slow toggling based on a user provided threshold between successive button events. If the rotary is moved fast enough that consecutive button events are received within a threshold, a fast virtual button is sent and successive button events are ignored. Otherwise a slow virtual button is sent for each button event if consecutive events are not received within the threshold. If your device is "glitchy" and regularly generates spurious fast events even when turning the rotary slowly, you can tell the module to treat a configurable number of fast events received within a time period as slow events.
Each virtual button can be assigned in the .ini to send FS control commands and keypresses, such as variable rates for trim adjustments on an elevator trim wheel, ref p.25 of the Advanced User's Guide.
This module provides a generally similar concept to the Rotaries.lua approach but takes advantage of buttons that are directly detected by FSUIPC and is primarily event-based rather than poll-based. Thus it should be more efficient/performant.
Define the desired buttons according to the array passed to the init() function at the bottom of the file.
[Originally posted in old SimMarket support forums by Blake Buhlig]
Note when using this script, the virtual buttons will not be seen in the button assignments panel. This is because the event.offset and event.button functions are not called when the buttons assignment panel is open. Therefore, to assign to the virtual buttons, you should first assign to the physical buttons and then edit your FSUIPC7.ini to manually change the assignments to the virtual buttons (including duplicating the physical button assignment to create two virtual button assignments and changing the control for the fast/slow movement).
For an alternative solution that uses polling and so the virtual buttons can be seen on the assignments panel, together with examples on how to assign to the virtual buttons for the different functions of the selector knob, see
John
-
ATR IdleGate and Landing data4 months ago
-
Persistent Random Failure4 months ago
-
Saitek Multi Panel - Posky 7774 months ago
-
ELITE King Air Throttle Quadrant for PMDG and other planes4 months ago
-
Pokeys Device Lua Script / External DLL using luacom4 months ago
