Topics

Questions: Changing shortcuts with NVDA on app

Sean
 

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

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

وفيق طاهر
 

Press Shift 5 times
Use Sticky Keys 
 in a row, the hibernate function will work this way. You do not need to press multiple keys
Greetings
 

James Scholes
 

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.

Luke Davis
 

Wouldn't this be a job for Autohotkey or similar?, and not something the screen reader should be doing?

Luke

On Wed, 13 May 2020, 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
 

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.

Sean
 

Deleted code:
import appModuleHandler, keyboardHandler

class AppModule(appModuleHandler.AppModule):
    def script_SendSU(self, gesture):
        keyboardHandler.KeyboardInputGesture.fromName('shift+alt+p').send()

    __gestures = {
        "kb:ALT+D": "SendSU",

        }


On 13/05/2020 10:29, Sean via groups.io 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.

--

Sean

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

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.


Sean
 

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.


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.


Sean
 

Hi all,

None of these options work.

There is nothing on the screen of the app I use.
So a menu, button, etc.

I want to be able to use this in a game. Mortal kombat.

NVDA cannot send shortcut.
I also tried the script that Ibrahim sent. Nothing.

On 14/05/2020 10:11, Cyrille via groups.io wrote:

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.


--

Sean

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

Ibrahim Hamadeh
 

Hi
may be if you provide the piece of the log when the script is executed, may be that will help to figure the issue better.
try to change the logging level to debug, then press the gesture of your script, then open log viewer with NVDA+f1, then up arrow to piece of log where the script is executed, copy that piece of the log and paste it in the message.
regards.

On 5/17/2020 12:42 PM, Sean wrote:

Hi all,

None of these options work.

There is nothing on the screen of the app I use.
So a menu, button, etc.

I want to be able to use this in a game. Mortal kombat.

NVDA cannot send shortcut.
I also tried the script that Ibrahim sent. Nothing.

On 14/05/2020 10:11, Cyrille via groups.io wrote:

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.


--

Sean

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