Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL pane: conrol keys aren't passed to ESP8266 #8

Closed
peterhinch opened this issue Aug 13, 2016 · 1 comment
Closed

REPL pane: conrol keys aren't passed to ESP8266 #8

peterhinch opened this issue Aug 13, 2016 · 1 comment

Comments

@peterhinch
Copy link

This severely limits its usability. The fix under Linux is as follows, but evidently testing is needed on Mac and Windows, which I'm not equipped to do.
interface.py

    def keyPressEvent(self, data):
#lines omitted
        elif data.modifiers() == Qt.ControlModifier:
        #     # Handle the Control key.  I would've expected us to have to test
        #     # for Qt.ControlModifier, but on (my!) OSX Qt.MetaModifier does
        #     # correspond to the Control key.  I've read something that suggests
        #     # that it's different on other platforms.
        #     # see http://doc.qt.io/qt-5/qt.html#KeyboardModifier-enum
             if Qt.Key_A <= key <= Qt.Key_Z:
        #         # The microbit treats an input of \x01 as Ctrl+A, etc.
                 msg = bytes([1 + key - Qt.Key_A])
        self.serial.write(msg)

The board now responds correctly to ctrl-A ctrl-B ctrl-C ctrl-D and ctrl-E

@eduvik
Copy link
Owner

eduvik commented Oct 11, 2016

Fixed in 1b0e2e3

@eduvik eduvik closed this as completed Oct 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants