SnapCode Mouse and Keyboard Sensing

This week we added a number of new features to SnapCode. The first is that the scene and actor classes now have methods to determine if the mouse has been clicked or if the mouse is being continuously held down:

isMouseClicked()
isMousePressed()

These can be used inside of “if” statement conditionals to perform operations only when the mouse is clicked (or continuously held down).

Similarly, the scene and actor classes now have keyboard sensing methods:

isKeyClicked(“name”)
isKeyPressed(“name”)

Where the name is just the key character, like “a”, “b”. Arrow keys can be specified with “right”, “left”, “up”, “down”.

Check out this video to see the new mouse keyboard sensing methods in action:

Mouse Keyboard Sensing

Thumbnail

Advertisements

2 Responses to “SnapCode Mouse and Keyboard Sensing”

  1. JavaFX links of the week, March 10 // JavaFX News, Demos and Insight // FX Experience Says:

    […] Martin posted an update to SnapCode this week with new Mouse and Keyboard sensing features, new pen graphics features and numerous improvements and […]

  2. Java desktop links of the week, March 10 « Jonathan Giles Says:

    […] Martin posted an update to SnapCode this week with new Mouse and Keyboard sensing features, new pen graphics features and numerous improvements and […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: