Re: Questions: Changing shortcuts with NVDA on app


Cyrille
 

Hello

An other option is to modify your gestures.ini file:

In the [globalCommands.GlobalCommands] section, add the following line:

kb:control+d=kb:control+p

You can also add it in another section if you want your gesture to be operating only in a specific class of object.


A limitation however for this solution as well as for the other solutions presented on this list is that all the modifiers from the input gesture (right-hand side) should also belong to the output gesture (left-hand side).

For example, in Notepad (French), you can use alt+E to open the Edit menu. However, you cannot remap control+G to alt+E this way:

kb:alt+e = kb:control+g

Indeed, when NVDA emulates alt+E gesture, the control key is also pressed and thus, a control+alt+E will be issued instead. We can check it because the Edit menu was not activated and the € (euro) sign has been typed instead.

Cheers,

Cyrille



Cheers,


Cyrille

Le 14/05/2020 à 08:21, Sean a écrit :
Thanks Ibrahim . 

Sean

I'm student and programmer. I write often Python, sometimes Go and rare C++.
I can understand Turkish and English. 


Ibrahim Hamadeh <ibra.hamadeh@...> şunları yazdı (14 May 2020 04:20):

 hi
try this way , I tested it and it worked for me
to replace control+p gesture with control+d:
from keyboardHandler import KeyboardInputGesture
import inputCore
import globalPluginHandler

class GlobalPlugin(globalPluginHandler.GlobalPlugin):

    def script_test1(self, gesture):
        ges= KeyboardInputGesture.fromName('control+p')
        inputCore.manager.emulateGesture(ges)
    __gestures= {
    'kb:control+d': 'test1',
    }
regards.
On 5/13/2020 10:29 AM, Sean wrote:

Hi James ,

Thank you so much for your help.

However, I wrote a script like this and couldn't run it.
No errors are returned.
NVDA detect appModule. But it doesn't work.

I don't know Sticky.
I will use this little thing for my own problem. I will not publish Addon.

The link is here:
https://paste.ubuntu.com/p/g6b36jvnbt/

On 13/05/2020 06:33, James Scholes wrote:
As somebody else suggested, sticky keys is an option.  But you can also simply create an app module which binds Control plus P to an NVDA script, and then have that script just send the Control plus D gesture. Something like: keyboardHandler.KeyboardInputGesture.fromName('control+d').send()

Regards,

James Scholes

On 12/05/2020 at 9:45 pm, Sean wrote:
Hi all,

Some apps have very different combinations of shortcuts.
I find it difficult to open my fingers long because of the problem on my wrist.

Can I change an application's shortcuts by writing appModule with NVDA?
Sample :
I want to assign ctrl+p to ctrl+d.
Which modules should I use?
Thank you so much?


    Sean

  * Twitter: Friedrich Sargon <https://twitter.com/FriedrichSargon>
  * Email: seantolstoyevski@...
    <mailto:seantolstoyevski@...>
  * GitHub: SeanTolstoyevski <https://github.com/SeanTolstoyevski/>

I’m student and programmer. I write often Python, sometimes Go and rare C++.
I can understand Turkish and English.





--

Sean

I’m student and programmer. I write often Python, sometimes Go and rare C++.
I can understand Turkish and English.


Join nvda-addons@nvda-addons.groups.io to automatically receive all group messages.