Make sure to select right-clicked item on windows when Control is pressed

This commit is contained in:
DarkPhoenix
2019-10-02 13:19:46 +03:00
parent acbd8a3298
commit 813db9340f

View File

@@ -301,10 +301,13 @@ class Display(wx.ListCtrl):
def ensureSelection(self, clickedPos):
"""
On mac, when right-click on any item happens, it doesn't get selected.
This method ensures that selection actually happens.
On windows with Ctrl is pressed, or on Mac, when right-click on any item happens,
the item doesn't get selected. This method ensures that only clicked item is selected.
"""
if 'wxMac' in wx.PlatformInfo:
if (
'wxMac' in wx.PlatformInfo or
('wxMSW' in wx.PlatformInfo and wx.GetMouseState().GetModifiers() == wx.MOD_CONTROL)
):
if clickedPos != -1:
selectedPoss = self.getSelectedRows()
if clickedPos not in selectedPoss: