Understanding Input Events Like onKeyPress and onClick Within EmEditor

Understanding Input Events Like onKeyPress and onClick Within EmEditor

Jason Lv8

Understanding Input Events Like onKeyPress and onClick Within EmEditor

November 23, 2008 at 5:12 pm #6656

dreftymac

Participant

I don’t know if there is a way to trigger a macro with a mouse click, but you can trigger a macro using a keyboard shortcut. You can also use a single keyboard shortcut to trigger multiple choices for the user, so you do not have to restrict your macro to doing just one “action”.

The following example uses the document.selection and the CreatePopupMenu function inside a jsee macro. The popup menu gives the user multiple choices before displaying the result.

var vtext   =   document.selection.Text;  

var result  =   '';  

var menu    =   CreatePopupMenu();              

menu.Add("look north", 1);  

menu.Add("look south", 2);  

menu.Add("look east", 3);  

result = menu.Track(0);              

if(result != 0) {  

    result  = (menu.GetText(result));  

Window.alert([result,vtext].join(' '));

Also read:

  • Title: Understanding Input Events Like onKeyPress and onClick Within EmEditor
  • Author: Jason
  • Created at : 2024-12-07 16:08:47
  • Updated at : 2024-12-14 16:00:57
  • Link: https://win-great.techidaily.com/understanding-input-events-like-onkeypress-and-onclick-within-emeditor/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Understanding Input Events Like onKeyPress and onClick Within EmEditor