This code works fine with FS2020, but with FS2024 doesn’t work:
textbox.addEventListener(“focus”,function(event){
event.preventDefault();
Coherent.trigger(“FOCUS_INPUT_FIELD”);
});
textbox.addEventListener(“blur”,function(event){
event.preventDefault();
Coherent.trigger(“UNFOCUS_INPUT_FIELD”);
});
The keys continue to perform their functions in the simulator even though you are typing text into the field.
¿?
EFB tablet has the same problem.
For example: if I write into any field of Flight Details each key is executed with the function assigned to the sim while I am writing.
A concrete example: If I press backspace the view goes to external and if I press again, the view goes to the cockpit.
Any way to fix this or any workaround that someone is using?
We have this issue yet.
Does anyone know how to solve it?
Well, that’s a bummer.
I was going to use that (as suggested here Disable Bound Key Events when input into toolbar apps ) but if it’s broken, I guess not!
Have you tried the code suggested by @runshotgun in the link above?
I haven’t got around to testing it yet, maybe that works?
1 Like
saschl
December 23, 2024, 12:27am
4
Yes this should work, we do use the same and it works fine. Just the backspace key still does trigger a switch to external view, but all other keys are blocked.
Just unbind the backspace key then.
Keyboard should never use single key binds for common use cases (such as typing/editing) anyway, most especially if they know they have issues with event propagation.
saschl
December 23, 2024, 10:13am
6
Yes, still a bug then with that specific key IMO. Just wanted to say that in general the solution works.
Do you know any place where I can consult the documentation to learn Coherent calls? Or is it all based on reading ASOBO code?
Docs are still a WIP but Coherent.js + searching the code for calls of interest should help.
The MSFS Avionics Framework | MSFS Avionics Frameworks and Instruments source code is also a useful reference, even if you’re not going to use it.
1 Like
system
Closed
January 22, 2025, 1:54pm
11
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.