Code help with Python


Babbage - Ahmed
 

Hello dear developers, I would greatly appreciate some help with code. Here's the deal:

I have a dictionary, right below

__gestures = {
"some_gesture": someObject.someFunction(x,y),
"another_gesture": anotherObject.someFunction(x,y),
"final_gesture": finalObject.someFunction(x,y)
}

#this is my function, which performs a mouse click on specific coordinates on the screen
def someFunction(x,y):
  mouseClick(x,y)

#this is my object. The attributes, x and y, are coordinates
myObject = Object(20, 20)
otherObject = Object(30,40)


The point of this code is to perform someFunction() on a certain gesture on the keyboard, like "NVDA+shift+a". In this example, I have 3 different gestures, and I want them all to do the function of someFunction(x,y). Every object has different x and y coordinates, so every object will click the mouse on different parts of the screen. To illustrate another example, check this explanation:

__gestures = {
"when I press shift+a": "perform someFunction(30, 40",
"when I press shift+b": "perform someFunction(50, 30)",
"when I press shift+c": "perform someFunction(40, 40)"
}

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