Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Event Handler, but the Key Evnet has a Parameter

Featured Replies

  • Commercial Member

Anyone have any ideas into this one:This works:void FSAPI EventHandler (ID32 event, UINT32 evdata, PVOID userdata) { if (event == KEY_ROTOR_BRAKE) { speed_bug_right++; }}Here I am capturing when Rotor Brake has been fired.What happens is that any time the key rotor brake event is fired in simulation, the speed bug variable increments by one.This code works fine.However...I want to be able to capture this:if (event == KEY_ROTOR_BRAKE, 3939)Note the extra parameter, 3939.So basically I'm trying to capture this event when it happens:trigger_key_event (KEY_ROTOR_BRAKE, 3939);But it doesn't work. The extra parameter messes things up somehow. It results in speed_bug_right var increasing all by itself for some reason, 18 times a second, even though no ROTOR BRAKE is not firing at all.Any ideas?

  • Author
  • Commercial Member
IIRC neither userdata or evdata ever worked.-Dai
I should engage my brain before writing in this forum :( Actually, I got it to work, like this:if ( (event == KEY_ROTOR_BRAKE) && (evdata == 26801) )This will read parameter associated with the Rotor Brake.So whenever that event is fired, you can do something.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.