Hello!
You see, lately I am more encouraged to proceed with the project, if only to think (because the development phase still is not officially open). This post is about the library as we mentioned in the previous.
I noticed that both the editor and the compiler are just accessories. The only thing necessary is the library. I mean, the ultimate goal will be a script , the compiler generated from a project created with the editor. Well, that script can be written by hand (obviously do not want that to be always true, but to test the library is valid). So the part that will begin this: Gexto.
As I have thought, one of the main functions will be to emulate human behavior, that is, generating keyboard events and mouse. Currently, most systems that will run this application has only one device of each type (if this changes, we'll see: D). Thus, intuitively, we have two objects, one for the keyboard and one for the mouse (two separate singleton ;)). These objects have an interface to programmatically control devices . For example, for the mouse, you should be able to move, press the right button, release (with support for all possible buttons, of course: D), get your position, etc. And for the keyboard idem.
I would outline the interfaces here. Let's see. The mouse:
class Mouse:
def getPosition (self): pass
def moveTo (self, x, y, abs = True): pass
pressButton def (self, button): pass
releaseButton def (self, button): pass
The arguments x and y are integers indicating the position and abs specifies if the motion is absolute (from position 0.0 root window ), or on the current mouse position. Button is an integer that indicates the number of button press. You can add some methods to simplify some common tasks, for example, a leftclick (), or Dragt (). The keyboard could be something like: class
Keyboard:Again, also add some methods for common tasks. In this case, very often want to introduce many characters in a row, instead of going one by one. To do this, something like generateKeyEvents ( seq) would be useful, where seq is a string.
pressKey def (self, key): pass
releaseKey def (self, key): pass
Well, I think for today, I have enough: D. Until the next post!
0 comments:
Post a Comment