fredsa / playn

Cross platform game library for N≥4 platforms
0 stars 1 forks source link

mouse() should report null on Android #167

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. calling PlayN.mouse()

What is the expected output? What do you see instead?
Expected: null
Actual: object that does nothing.

What version of the product are you using? On what operating system?
PlayN 1.2

Please provide any additional information below.
Per documentation, PlayN.mouse() should return null to indicate there is no 
mouse. This has worked on older versions of PlayN including 1.1.1. Returning a 
dummy mouse object makes little sense. Are there other ways to detect if the 
platform has a mouse or not?

Original issue reported on code.google.com by xtophena...@gmail.com on 3 May 2012 at 2:35

GoogleCodeExporter commented 9 years ago
Fixed in 9571edaeb4a775167d257bb496953b87ff472788.

Mouse and Touch now provide hasMouse() and hasTouch() methods, respectively.

This is a more robust method for determining whether the environment in which 
the game is running has mouse or touch interactions. Relying on the platform to 
return a null service would fail if you were using the HTML backend on a 
browser that did or did not support mouse or touch interactions, as the HTML 
backend always returns a mouse and touch service. They simply do not generate 
mouse or touch events on platforms that don't support such interactions. 
Android may some day support a mouse service if Android devices allow a 
bluetooth mouse to be used with them and would naturally not return null for 
mouse() at that point.

Original comment by samskiv...@gmail.com on 3 May 2012 at 8:25