March 28, 201016 yr 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? B. York FS2Crew Web Site / FS2Crew Facebook Page / FS2Crew Discord
March 29, 201016 yr Author Commercial Member IIRC neither userdata or evdata ever worked.-DaiI 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. B. York FS2Crew Web Site / FS2Crew Facebook Page / FS2Crew Discord
March 29, 201016 yr Commercial Member Interesting... (pokes old code and finds memo from Arne)... yes, evdata always did work (apologies for FIM) but neither I nor Arne could get userdata to work. Has anyone else succeeded?-Dai
Create an account or sign in to comment