add screenshot binary + correct mistakes on README
This commit is contained in:
28
README.md
28
README.md
@@ -84,29 +84,35 @@ The client code looks like this:
|
||||
|
||||
```
|
||||
from rdpy.protocol.rdp import rdp
|
||||
|
||||
class MyRDPFactory(rdp.ClientFactory):
|
||||
def buildObserver(self, controller):
|
||||
|
||||
def clientConnectionLost(self, connector, reason):
|
||||
reactor.stop()
|
||||
app.exit()
|
||||
|
||||
def clientConnectionFailed(self, connector, reason):
|
||||
reactor.stop()
|
||||
app.exit()
|
||||
|
||||
def buildObserver(self, controller, addr):
|
||||
class MyObserver(rdp.RDPClientObserver)
|
||||
def __init__(self, controller)
|
||||
rdp.RDPClientObserver.__init__(self, controller)
|
||||
def onBitmapUpdate(self, destLeft, destTop, destRight, destBottom, width, height, bitsPerPixel, isCompress, data):
|
||||
|
||||
def onUpdate(self, destLeft, destTop, destRight, destBottom, width, height, bitsPerPixel, isCompress, data):
|
||||
#here code handle bitmap
|
||||
pass
|
||||
|
||||
def onReady(self):
|
||||
#send 'r' key
|
||||
self._controller.sendKeyEventUnicode(ord(unicode("r".toUtf8(), encoding="UTF-8")), True)
|
||||
#mouse move and click at pixel 200x200
|
||||
self._controller.sendPointerEvent(200, 200, 1, true)
|
||||
|
||||
def onClode(self):
|
||||
pass
|
||||
|
||||
return MyObserver(controller)
|
||||
|
||||
def startedConnecting(self, connector):
|
||||
pass
|
||||
def clientConnectionLost(self, connector, reason):
|
||||
pass
|
||||
def clientConnectionFailed(self, connector, reason):
|
||||
pass
|
||||
|
||||
from twisted.internet import reactor
|
||||
reactor.connectTCP("XXX.XXX.XXX.XXX", 3389), MyRDPFactory())
|
||||
reactor.run()
|
||||
|
||||
Reference in New Issue
Block a user