Add simple event "touch" to multi-touch Windows 7 messages

Bug #616382 reported by Guillermo Andrade on 2010-08-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description


This is a little patch for panda/windisplay/winGraphicsWindow.cxx to post events for WM_TOUCH messages from Windows 7.
For every touch a event named "touch" is sended using throw_event.
event parameter are :
- id of touch
- flags of touch
- x and y that are position of touch in windows coordinates.

There is a simple way to test this patch:


import direct.directbase.DirectStart #Initialize Panda and create a window

from direct.showbase.DirectObject import DirectObject
import sys

class World(DirectObject): #Our main class
  def __init__(self):
    self.accept("touch", self.handleTouch)

  def handleTouch(self,id,flag,x,y):
      print "touch : id=",id," flag=", flag, " x= ",x," y=", y

w = World()

rdb (rdb) wrote :

Would it perhaps be more consistent to have touch-up and touch-down events?

Changed in panda3d:
importance: Undecided → Wishlist

there are 3 states passed on "flag" message parameter: UP, DOWN and MOVE.
If you want to have different messages for all states then you need 3 messages : "touch-down", "touch-move" and "touch-up".
Il will try to send you next week a new patch with this.

rdb (rdb) on 2016-12-22
tags: added: windows
removed: contrib windows7
rdb (rdb) wrote :

Marking Incomplete due to inactivity.

Changed in panda3d:
status: New → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for Panda3D because there has been no activity for 60 days.]

Changed in panda3d:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers