Skip to Content
1
Sep 18, 2018 at 12:39 PM

Personas Slipstream - How to add functionality for the Enter key?

521 Views

Hi,

We are running Personas 3.0 SP7.

Under the traditional rendering engine, I was able to add script like the following example to the onEnter screen event to handle events when the Enter key was pressed.

// Ignore the event if it wasn't fired by the Enter key.
if (triggerType !== source.EVENT_ENTER) return;


// If the Enter key was pressed inside a textbox, click a button.
if (focused && focused.id === session.findById("wnd[0]/usr/boxPersonas_149010509512345/txtPersonas_149434590467890").id){
    session.findById("wnd[0]/usr/btnPersonas_149019811223344").press();
  }

Under Slipstream, this code displays an error message saying "ReferenceError: triggerType is not defined".

If I remove the triggerType line of script, the code displays an error message saying "ReferenceError: focused is not defined".

I tried adding session.utils in front of triggerType and focused. The code no longer displays an error, but session.utils.triggerType and session.utils.focused both come back as 'undefined', so that is not a solution.

Does anyone know how to check if the Enter key was pressed, and determine which object had focus when it was, in Slipstream?

Thank you very much for your help!