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

Function keys? Arrow keys? #303

Closed
dicroce opened this Issue Nov 24, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@dicroce

dicroce commented Nov 24, 2017

How do I specify the arrow keys or the F1-N keys when using bindKey()?

@jarvisteach

This comment has been minimized.

Owner

jarvisteach commented Nov 26, 2017

You should be able to bind any of the keys using this function, check out the list here for the name of every key:

http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm

The arrow keys are: <Up>, <Down>, <Left>, <Right> and the function keys will look like: <F1> etc...

For example:

from appJar import gui 

def press(btn):
    print(btn)

app=gui()
app.addLabel("title", "Red")
app.setBg("red")

app.bindKey("<Up>", press)
app.bindKey("<Down>", press)
app.bindKey("<Left>", press)
app.bindKey("<Right>", press)
app.bindKey("<Right>", press)
app.bindKey("<F1>", press)
app.bindKey("<F2>", press)

app.go()
@jarvisteach

This comment has been minimized.

Owner

jarvisteach commented Nov 26, 2017

I'll update the docs to include some details on this...

jarvisteach added a commit that referenced this issue Nov 26, 2017

@jarvisteach

This comment has been minimized.

Owner

jarvisteach commented Nov 26, 2017

I'm also going to add two extra functions to .bindKeys() and .unbindKeys() that will both take a list of keys and call the bind/unbind function...

@jarvisteach jarvisteach added this to the 0.90 milestone Nov 26, 2017

jarvisteach added a commit that referenced this issue Nov 26, 2017

jarvisteach added a commit that referenced this issue Nov 26, 2017

@dicroce

This comment has been minimized.

dicroce commented Nov 26, 2017

Cool. That is exactly what was needed. :) I was able to get my app done with your help (a metadata tagger for VOC format image databases for deep learning).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment