[wxpython-users] Hold shift/ctrl + mouse click?
Søren Nielsen
soren.skou.nielsen at gmail.com
Thu Apr 10 06:06:39 PDT 2008
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 at gmail.com>
wrote:
> Hi Soren,
>
> On Thu, Apr 10, 2008 at 1:49 PM, S=F8ren 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 =3D 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
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200804=
10/5542ffa9/attachment.htm
More information about the wxpython-users
mailing list