Metadata-Version: 2.1
Name: qvncwidget
Version: 0.2.0
Summary: VNC QT Widget for Python using PyQt5
Home-page: https://github.com/zocker-160/pyQVNCWidget
License: GPLv3+
Author: zocker_160
Author-email: zocker1600@posteo.net
Requires-Python: >=3.7,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: PyQt5 (>=5.11.3,<6.0.0)
Requires-Dist: pyDes (>=2.0.1,<3.0.0)
Requires-Dist: service-identity (>=21.1.0,<22.0.0)
Project-URL: Repository, https://github.com/zocker-160/pyQVNCWidget
Description-Content-Type: text/markdown

# pyQVNCWidget
VNC Widget for Python using PyQt5

_NOTE:_ This project is pretty much still in WiP status and I am struggling with the PIXEL_FORMAT.\
So if someone knows a way to fix it or a better way of doing it in the first place, I would be happy about PRs ;)

## How to install

```bash
pip3 install qvncwidget
```

### TODO:
- Proper error handling `onFatalError`
- support for more than just RAW and RGB32 PIXEL_FORMATs
- support for compression
- implement rfb 3.7 and 3.8

## Examples (see /examples folder)

```python
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from qvncwidget import QVNCWidget

class Window(QMainWindow):
    def __init__(self):
        super(Window, self).__init__()

        self.initUI()

    def initUI(self):
        self.setWindowTitle("QVNCWidget")

        self.vnc = QVNCWidget(
            parent=self,
            host="127.0.0.1", port=5900,
            password="1234"
        )
        self.setCentralWidget(self.vnc)
        self.vnc.start()

app = QApplication(sys.argv)
window = Window()
#window.setFixedSize(800, 600)
window.resize(800, 600)
window.show()

sys.exit(app.exec_())

```
### Example with key input (since 0.2.0)
```python
import sys

from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtGui import QKeyEvent
from qvncwidget import QVNCWidget

class Window(QMainWindow):
    def __init__(self, app: QApplication):
        super(Window, self).__init__()

        self.app = app
        self.initUI()

    def initUI(self):
        self.setWindowTitle("QVNCWidget")

        self.vnc = QVNCWidget(
            parent=self,
            host="127.0.0.1", port=5900,
            password="1234"
        )
        self.setCentralWidget(self.vnc)
        self.vnc.start()

    def keyPressEvent(self, ev: QKeyEvent):
        self.vnc.onKeyPress.emit(ev)

    def keyReleaseEvent(self, ev: QKeyEvent):
        self.vnc.onKeyRelease.emit(ev)

app = QApplication(sys.argv)
window = Window(app)
window.resize(800, 600)
window.show()
```

## References

- https://datatracker.ietf.org/doc/html/rfc6143
- https://vncdotool.readthedocs.io/en/0.8.0/rfbproto.html?highlight=import#string-encodings

