I am not sure... As far as I can tell, I just get events for button 1, 2 and 3 of the mouse. If the touch screen does not send a click without dragging as a left click, then I don't know how to detect it. Maybe the touchscreen's drivers are not suitable for DirectInput?
I guess it DOES work without DirectInput, and using the "usual" WM_CLICK messages. You could check in windowProc (or something like that) in WindowWin.cpp if you still get those, even though I subscribe to DirectInput data. If so, you could cheat for a start and just call input().onButtonDown(msLeft) in that case. ;)
Yeah, that's true... the mouse button 0 (case DIMOFS_BUTTON0:) block in InputWin.cpp... that's actually being called on a regular left click and works fine with the touch screen. The problem is somewhere after that. I'll keep debugging tomorrow. Thanks again for your help
Everything in c++ gosu is working fine with the touch screen. I've moved on to the Ruby extension. In the generated file RubyGosu_wrap.cxx, I added debug statements to this method
SWIGINTERN VALUE_wrap_Window_button_down(int argc, VALUE *argv, VALUE self)
and it's working fine as well
So it's going awry somewhere between there and the calls to button_down? in Ruby...
any guesses? unfortunately, i have almost no knowledge of SWIG. anyway, i'll keep looking but if you happen to see this post ( and are really bored :) ), where would you look next?
Just to make sure, you are not confusing button_down and button_down?, are you? :) How are you detecting the clicks?
If you use button_down? to check for them, then it might be that the touch screen indeed sends a click, but immediately afterwards releases it. That would make button_down? always return false, but it would still trigger a button_down callback.
Bearing with you? ;) I have never seen Gosu in action with a touchscreen, even though I heard at least a couple of people are doing it. Please document whatever gadget you're building :)
Yeah, for sure. (It's pretty cool). :) Also, it's in my plans to add Windows 7 multitouch support to Gosu although there are more essential features that I need to work on first.
Gosu already supports multi-touch on the iPhone via the very Apple-esque touchesBegan, touchesMoved, touchesEnded events- if that interface matches your needs, that would be very convenient. :)