[nvda-addons] Re: Executing NVDA commands programmatically

  • From: "Pranav Lal" <pranav.lal@xxxxxxxxx>
  • To: <nvda-addons@xxxxxxxxxxxxx>
  • Date: Thu, 23 Jul 2015 22:36:32 +0530

James,

Ignore my previous message. I remembered that I had solved my gesture mapping
issue by using the global commands dictionary so I need to find the format in
which I have to pass the name of the key to
keyboardHandler.KeyboardInputGesture.fromName.

Sorry for any confusion I may have caused.

Pranav
-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-bounce@xxxxxxxxxxxxx] On Behalf Of James Scholes
Sent: Thursday, July 23, 2015 5:37 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Executing NVDA commands programmatically

Hi Pranav,

It just so happens that somebody else has been asking very similar questions on
the nvda-devel mailing list recently. Here's a reply from one of NVDA's lead
developers that might help.

The first thing to consider is why you're trying to directly call a
script, as this determines the best way to do it. 1. If you're trying
to just emulate a key press from a user and you want NVDA to respond
as it always would (e.g. you want to pretend the user pressed up
arrow), use inputCore.manager.emulateGesture. Make the relevant
gesture using keyboardHandler.KeyboardInputGesture.fromName. 2. If you
want to call an NVDA specific command (e.g. you wanted to call the
date time command from another script for some reason), you should be
able to just execute the script and pass None for the gesture; e.g.
scriptHandler.executeScript(globalCommands.commands.script_dateTime,
None). However, this isn't something you really should be doing unless
there is a very good reason.
--
James Scholes
http://twitter.com/JamesScholes
----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting
bugs.

Community addons are available from: http://addons.nvda-project.org To send a
message to the list: nvda-addons@xxxxxxxxxxxxx To change your list
settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.

Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe:
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

Other related posts: