Thanks Andrea, however, Im using it with a ListBox… which means that then I use EVT_LEFT_CLICK, the left click event that selects items in the Listbox gets overwritten? So now the listbox doesn’t work…
I should have said it was for selecting multiple items in a listbox with a shift -mouse click
Soren
···
On Thu, Apr 10, 2008 at 2:54 PM, Andrea Gavana andrea.gavana@gmail.com wrote:
Hi Soren,
On Thu, Apr 10, 2008 at 1:49 PM, Søren Nielsen wrote:
Does anyone here know how to create an event for holding down the shift or
Ctrl key, and pressing the left mouse button?
Well, what you could do, is to bind the left mouse button like this:
yourCtrl.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
And then in your method:
def OnLeftDown(self, event):
state = wx.GetMouseState() if state.ShiftDown() and state.ControlDown(): # Here you are, left click + Ctrl + Shift down :-D event.Skip()
HTH.
Andrea.
–
Andrea.
“Imagination Is The Only Weapon In The War Against Reality.”
http://xoomer.alice.it/infinity77/
wxpython-users mailing list