GoogleCodeArchive / piccolo2d

Automatically exported from code.google.com/p/piccolo2d
0 stars 0 forks source link

PInputEvent doesn't filter by modifier #100

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a PInputEventFilter and set its modifiers to be 
InputEvent.InputEvent.ALT_DOWN_MASK
2. Create a simple InputEvent without any modifiers
3. call acceptsEvent on the input event

What is the expected output? What do you see instead?
Expected output is that the event should not be accepted.

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

Please provide any additional information below.
It's clearly written to behave that way since "(modifiers == 0 || ..." 
bypasses the modifier constraint logic.  (modifiers is populated by 
examining the incoming event)

I think however that the logic should *never* bypass it. 

Original issue reported on code.google.com by allain.lalonde on 17 Jul 2009 at 7:51

GoogleCodeExporter commented 9 years ago
Fixed in r493

Plastered PInputEventFilter with Unit Tests and then made
it consider the masks conditionally.

andMask if it's non-zero
notMask if it's non-zero
orMask if it's not ALL_MODIFIERS (I can't think of a case where you might
want to say, "Only allow events as long as they have a modifier, I don't
care which one")

Original comment by allain.lalonde on 17 Jul 2009 at 9:54

GoogleCodeExporter commented 9 years ago

Original comment by heue...@gmail.com on 28 Jul 2009 at 1:36