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

Allow access to some Ion functions from Python #797

Closed
instrangeland opened this issue Nov 28, 2018 · 5 comments
Closed

Allow access to some Ion functions from Python #797

instrangeland opened this issue Nov 28, 2018 · 5 comments
Labels
app-python Python application enhancement

Comments

@instrangeland
Copy link

One of the big issues I've seen with the Python environment on the Numworks calculator is that it is missing many of the features found in other calculator based programming languages. The most glaring of those is an input function. Even this, however, would not be necessary if Python could be given access to the Keyboard functions of Ion. Some ideas of what these should be (from the Python side.):

Ion.Keyboard.checkKey( keynumber (or some other identifier) ), returns bool true if pressed, false if not.

Ion.Keyboard.getKey() returns the number of the currently pressed key

Ion.Keyboard.keyPressed() returns true if any key is pressed, false if none are.

If a python script had access to the keyboard directly, with the work already done giving it access to the screen, a quick input function could be related. This is also a necessity for any sort of Graphical based python.

@boricj
Copy link
Contributor

boricj commented Nov 28, 2018

There's some ongoing work to improve the API provided in the Python app in general (turtle module: #748, improved kandinsky module: #748, time module: #626...). As for raw key readout specifically, I think there are a couple of issues with the Emscripten platform that are being addressed (#754, #755) before that API can be implemented.

@gpotter2
Copy link
Contributor

gpotter2 commented Jan 13, 2019

Seems all proposed PRa have been merged now :-)

@Ecco Ecco changed the title [Python Module Idea] Allow access to some Ion functions Allow access to some Ion functions from Python Mar 15, 2019
@Ecco Ecco added app-python Python application enhancement labels Mar 15, 2019
@Ecco
Copy link
Contributor

Ecco commented Mar 15, 2019

I'm going to close this issue since most of it has been addressed. Feel free to reopen specific issue if needed 😄

@Ecco Ecco closed this as completed Mar 15, 2019
@boricj
Copy link
Contributor

boricj commented Mar 16, 2019

Until we have at least a get_keys() and a fill_rect() function, this issue isn't really solved. #746 is a start to fix this and is advanced enough to allow simple real-time games like Pong.

@Ecco
Copy link
Contributor

Ecco commented Mar 17, 2019

Yes, but multi-topic issues are a pain in the ass, which is the main reason I closed this issue 😄 I created #925 to track the key reading function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-python Python application enhancement
Projects
None yet
Development

No branches or pull requests

4 participants