Simhub Java Help

Hi,

Firstly, sorry if this was posted to the wrong forum! I've got the Race Start screen mapped to a button on my wheel via keyboard emulation, but you have to press it a second time to go back to the normal screen. If anyone with a better knowledge of Java could help me figure out a way to make it such that if you get over a certain speed it defaults back to the normal screen I'd really appreciate it! The original code is:

if (root.visible == null) {
root.visible = 1;
root.buttonPressed =0;
}

let button = $prop('InputStatus.KeyboardReaderPlugin.C');

if (button > 0 && root.buttonPressed === 0) {
root.visible = !root.visible;
root.buttonPressed = 1;
}

if (root.buttonPressed === 1 && button ==0) {
root.buttonPressed = 0;
}

return !root.visible;
 
Back
Top