Skip to content

Fixed purple text bug, raw_input bug, and added keyboard mouse functionality#85

Open
sportsracer48 wants to merge 11 commits intogatech-csl:masterfrom
sportsracer48:master
Open

Fixed purple text bug, raw_input bug, and added keyboard mouse functionality#85
sportsracer48 wants to merge 11 commits intogatech-csl:masterfrom
sportsracer48:master

Conversation

@sportsracer48
Copy link
Copy Markdown

Ideally I would have submitted this pull request before adding any features, and it would just be bug fixes, but oh well. Here we are.

First, the bug fixes. If you stop running a program while waiting for raw_input, then the next time you run raw input it immediately throws an error. I fixed this by cancelling the prompt before halting the execution thread. This cannot be the right way to do it, but I'm not sure there is a better way.

I fixed the purple text bug by letting the main thread join the thread that initializes the name space. This removes what was before a race condition.

I also added a bunch of keyboard and mouse input features. As a student learning python with JES, I often wanted to be able to click on displayed pictures, or control them by pressing keys, not typing into the console. With these functions, those both become possible. They have direct queries (isKeyPressed, isLeftMousePressed) and a simplified event queue (hasKeyEvent, getKeyEvent).

It is the unfortunate truth that most people who want to learn to program want to make games. This allows them to do so, but it has other applications, like drawing or image manipulation user interfaces.

Last year I distributed a modified version of JES around my school, which allowed students to use keyboard/mouse input. Everyone who gained the ability immediately jumped on it, and began making games.

If games are what they want to make, why not let them.

I also added a buildAndRun.bat, for convenience.

@mjguzdial
Copy link
Copy Markdown
Contributor

Thanks for all the fixes! I'm going to save the keyboard and mouse events for JES 5.1. This release will be bug fixes only.

  • Mark

From: sportsracer48 [notifications@github.com]
Sent: Thursday, April 09, 2015 1:07 PM
To: gatech-csl/jes
Subject: [jes] Fixed purple text bug, raw_input bug, and added keyboard mouse functionality (#85)

Ideally I would have submitted this pull request before adding any features, and it would just be bug fixes, but oh well. Here we are.

First, the bug fixes. If you stop running a program while waiting for raw_input, then the next time you run raw input it immediately throws an error. I fixed this by cancelling the prompt before halting the execution thread. This cannot be the right way to do it, but I'm not sure there is a better way.

I fixed the purple text bug by letting the main thread join the thread that initializes the name space. This removes what was before a race condition.

I also added a bunch of keyboard and mouse input features. As a student learning python with JES, I often wanted to be able to click on displayed pictures, or control them by pressing keys, not typing into the console. With these functions, those both become possible. They have direct queries (isKeyPressed, isLeftMousePressed) and a simplified event queue (hasKeyEvent, getKeyEvent).

It is the unfortunate truth that most people who want to learn to program want to make games. This allows them to do so, but it has other applications, like drawing or image manipulation user interfaces.

Last year I distributed a modified version of JES around my school, which allowed students to use keyboard/mouse input. Everyone who gained the ability immediately jumped on it, and began making games.

If games are what they want to make, why not let them.

I also added a buildAndRun.bat, for convenience.


You can view, comment on, or merge this pull request online at:

#85

Commit Summary

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/85.

@alinacampan
Copy link
Copy Markdown

We are using JES at NKU for our CS 0.5 course, and been wondering if and when mouse/keyboard events will be available. Do you know when you will make JES 5.1 available (seems like your plans are to have events in version 5.1)?

Alina Campan

@alinacampan
Copy link
Copy Markdown

Sorry for a second comment on this - but we really, really want the new features you are planning for JES 5.1. Any way we could get a beta version now?

@mjguzdial
Copy link
Copy Markdown
Contributor

mjguzdial commented Jul 17, 2017 via email

@alinacampan
Copy link
Copy Markdown

Thank you for your answer.

Alina Campan

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

Successfully merging this pull request may close these issues.

3 participants