keyboard – EmEditor (Text Editor) https://www.emeditor.com Best Text Editor, Code Editor, CSV Editor, Large File Viewer for Windows (Free versions available) Sat, 23 Feb 2013 20:54:26 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 Wait for key press, get Key https://www.emeditor.com/forums/topic/wait-for-key-press-get-key/ Sat, 23 Feb 2013 20:54:26 +0000 .

Hi Yutaka

I need a feature to get the key an user has pressed.
I want to omit the usual InputBox() dialog.

Example script:

varK = GetKey();
alert(‘You have pressed ‘ + varK);

OR
– select a word
– execute macro
– macro is waiting for a key press

selText = document.selection.Text;
varK = “”;
while(varK==””){
  varK = GetKey();
  wait 200ms;
}
document.selection.Text = varK + selText + varK

The point is: no dialog involved!

Or perhaps useful for

while(varK.length < 5){
varK = varK + GetKey();
}

.

]]>