Writing XML gauge code....... how do you.......

...............get a keypress code to activate a gauge variable when the panel that the gauge is located ON is not actually currently displayed on the screen?
Need this to function sort of like pressing "G" for landing gear........ when any window view is actually being displayed.
best,
.......................john
Need this to function sort of like pressing "G" for landing gear........ when any window view is actually being displayed.
best,
.......................john