Giter Site home page Giter Site logo

Comments (4)

martinohanlon avatar martinohanlon commented on July 27, 2024

guizero simply returns what was is given to it by tkinter (the underlying GUI framework). If tkinter doesnt return these characters then there probably isnt a lot which can be done.

https://github.com/lawsie/guizero/blob/master/guizero/event.py#L33

The event object return also includes the underlying tk_event object which you may be able to interrogate to get at the non-printing characters. e.g.

 def enterKeyClicked(event):
    print("tk event object", event.tk_event)

app = App()

textbox = TextBox(app)
textbox.when_key_pressed = enterKeyClicked

app.display()

from guizero.

martinohanlon avatar martinohanlon commented on July 27, 2024

You can get the keycode from the tk_event which includes non-printing charactors.

from guizero import App, TextBox

def enterKeyClicked(event):
    print("keycode:" + str(event.tk_event.keycode))

app = App()

textbox = TextBox(app)
textbox.when_key_pressed = enterKeyClicked

app.display()

Suggest we add tk_event.keycode to the guizero event object at some point. Its a minor change to the event.EventData object.

from guizero.

lawsie avatar lawsie commented on July 27, 2024

Now in dev

from guizero.

martinohanlon avatar martinohanlon commented on July 27, 2024

Released in v1.4.0

from guizero.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.