Re: Questions: Changing shortcuts with NVDA on app


Ibrahim Hamadeh
 

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.