This is JavaScript and goes in the webpage (you can always inject the code if the original html page is not under your control)..
document.addEventListener('keydown', function (event) {
var tSpace = event.which == 32,
el = event.target,
input = el.nodeName != 'INPUT' && el.nodeName != 'TEXTAREA',
tStopPropagation = false;
if (input) {
if (tSpace) {
window.status = 'space'; // callback to RealStudio so we can stop the MsgBox
tStopPropagation = true;
}
// this is to reset it to allow this command to work again
// if we just clear out the 'space' status with an empty string, it does not work after the first time
window.status = '-';
if (tStopPropagation) {
event.preventDefault();
event.stopImmediatePropagation();
}
}
}, true);
This is the code in the StatusChanged event
Sub StatusChanged(newStatus as String)
if (newStatus = "space") then
// you need to declare the variable first and then set its value, you cannot do this in a single line
DIM tMoo As String
tMoo = "cow"
end if
End Sub