[PyQt] distinguish / enable / disable multiple pointer devices

Wolfgang Rohdewald wolfgang at rohdewald.de
Thu Mar 24 23:33:30 GMT 2011


On Freitag 25 März 2011, Gelonida wrote:
> I have a PC (Windows) with a mouse, a touch screen and a
> graphics tablet.
> 
> 
> Is there any way to know with which device a widget was
> clicked?

something like QKeyEvent, QMouseEvent, QTabletEvent,
QTouchEvent and QWheelEvent?

class MyWidget(QWidget):
  ...
  def mousePressEvent(self, event):
    if event.type() == QEvent.TabletPress:
      print '%s clicked with Tablet' % self.objectName()

It would be more difficult to differentiate between two mice

-- 
Wolfgang


More information about the PyQt mailing list