Demo: LVAR write access for any aircraft control

Thank you for sharing this code, it is clear. It certainly works fine in WASM by registering a key event handler, but I went for JavaScript instead. I tried to make this work with a JavaScript listener that I use to intercept key events, but it didn’t work. My code is like this:

this.keyListener = RegisterViewListener('JS_LISTENER_KEYEVENT', () => {
            Coherent.call('INTERCEPT_KEY_EVENT', 'AP_MASTER', 0);
            Coherent.call('INTERCEPT_KEY_EVENT', '0x11000', 0);
            Coherent.call('INTERCEPT_KEY_EVENT', '#0x11000', 0);
            this.keyListener.on('keyIntercepted', this.handleKeyIntercepted);
        });

If you are not familar to JavaScript, this defines a function (hadleKeyIntercepted) that receives all the key events, exactly like the EventHandler you defined in your code. The only difference is that instead of receiving ALL the event, it only receives the ones listed with Coherent.call(‘INTERCEPT_KEY_EVENT’.

It works perfect with AP_MASTER because this is a standard event, but I was unable to get the custom event #0x11000 that is sent through another app.
Any idea?

Thanks.