- AuthorPosts
- November 23, 2008 at 12:17 am #6650mashaMember
Hello.
How to hook all keyboard and mouse input for a given window ?
Can I write a macro which will handle Ctrl-click or Shift-click on the document window and then will do something with the clicked word?November 23, 2008 at 5:12 pm #6656dreftymacParticipantI 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(' '));November 24, 2008 at 7:09 pm #6661Yutaka EmuraKeymastermasha wrote:
Hello.How to hook all keyboard and mouse input for a given window ?
Can I write a macro which will handle Ctrl-click or Shift-click on the document window and then will do something with the clicked word?You can find some events by going to the Macros menu, Customize, check Runs at Events, and then click the Events button. But that is all we have. For mouse clicks, you will need to write a plug-in.
- AuthorPosts
- You must be logged in to reply to this topic.