From e44724fc4bae162cbe430cccb805cc14e9063259 Mon Sep 17 00:00:00 2001 From: Gyedo Jeon Date: Wed, 8 Aug 2007 03:50:51 +0000 Subject: [PATCH] Made alt modifier information get sent while mouse button 1 is still pressed --- direct/src/directtools/DirectSession.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/direct/src/directtools/DirectSession.py b/direct/src/directtools/DirectSession.py index bfe14bb78c..9bd5fc8582 100644 --- a/direct/src/directtools/DirectSession.py +++ b/direct/src/directtools/DirectSession.py @@ -118,6 +118,7 @@ class DirectSession(DirectObject): self.fControl = 0 self.fAlt = 0 self.fShift = 0 + self.fMouse1 = 0 # [gjeon] to update alt key information while mouse1 is pressed self.pos = VBase3() self.hpr = VBase3() @@ -374,8 +375,10 @@ class DirectSession(DirectObject): def inputHandler(self, input): # Deal with keyboard and mouse input if input == 'mouse1-up': + self.fMouse1 = 0 # [gjeon] to update alt key information while mouse1 is pressed messenger.send('DIRECT-mouse1Up') elif input.find('mouse1') != -1: + self.fMouse1 = 1 # [gjeon] to update alt key information while mouse1 is pressed modifiers = self.getModifiers(input, 'mouse1') messenger.send('DIRECT-mouse1', sentArgs = [modifiers]) elif input == 'mouse2-up': @@ -398,6 +401,11 @@ class DirectSession(DirectObject): self.fControl = 0 elif input == 'alt': self.fAlt = 1 + # [gjeon] to update alt key information while mouse1 is pressed + if self.fMouse1: + modifiers = DIRECT_NO_MOD + modifiers |= DIRECT_ALT_MOD + messenger.send('DIRECT-mouse1', sentArgs = [modifiers]) elif input == 'alt-up': self.fAlt = 0 elif input == 'page_up':