-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add GUI.wait_key, GUI.get_key to python bindings. #459
Conversation
how about |
Thanks for the PR! Yes, missing a mechanism to kill the GUI from keyboards is a design pitty. We should consider systematically redesigning the keyboard event handling. I feel like we should implement 3 APIs
This will allow Taichi users to create complex applications with keyboards, such as video games :-) What do you think? |
Good idea! |
Adding some aliases, eg. |
|
Awesome!
Let's make
Yeah, I agree that people usually don't distinguish left/right shifts. Let's just use
Good idea! I guess people would do a main loop like while True:
while gui.has_key_event():
event = gui.get_key_event()
process(event)
rendering, logic, etc. (user inputs during this period is added to the event queue) |
Before I merge this PR, could do
|
Oh...why? I discarded all changes in gui/win32.cpp (except no-eol), but it still fails. |
How can I make Travis fail? So that I can see the Details button of another fail. Well...it's ridiculous. But how can I see detailed message of the build when All checks have failed? |
Okay...seems problem comes from the git |
ci.appveyor.com seems being blocked... |
I can't see what's going on there, can you take a look of what's the error? Thanks! |
Ok, accessible now. |
Ok, I mistake |
Now event is a class |
Note: |
We're almost done! The only thing left to do is add mouse support for win32. But before that I need wait to see if there is any build errors on appveyor. |
Ok, both travis and apveyor build passed. You can merge this PR now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!!!
The new keyboard system is fantastic! See Line 101 in 017da2e
|
Cool physics! It's so nice to see our keyboard system working properly :) |
But lack of experience and environment of OS X, I'm not able to make keyboard support for OS X, sorry :) Maybe we should leave that development to ones who have a environment. |
I can take a look at the Mac keyboard events :-) (BTW, it would be great if the commits can be squashed to keep the master branch a cleaner timeline...) |
Great and thanks!
That's a good point. I think we should make simple rules for commits/commit messages/PRs and put it in https://taichi.readthedocs.io/en/latest/contributor_guide.html Let's move the discussions here: #466 |
Yeah, I see, commits titled |
Old, user need to click on the 'X' button of window:
You get
exit(1)
:and
do_some_thing_other()
won't be reached.New, user can kill GUI with ESC or space key: