Skip to content

Commit

Permalink
Disable input handler on input bug config.
Browse files Browse the repository at this point in the history
  • Loading branch information
joan authored and joan committed Feb 5, 2018
1 parent 283a6ab commit d947eb3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions PI_noaaWeather.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,9 +1180,10 @@ def createMetarWindow(self):
XPSetWidgetProperty(self.metarQueryOutput, xpProperty_Enabled, 1)
XPSetWidgetProperty(self.metarQueryOutput, xpProperty_TextFieldType, xpTextTranslucent)

# Register our widget handler
self.metarQueryInputHandlerCB = self.metarQueryInputHandler
XPAddWidgetCallback(self, self.metarQueryInput, self.metarQueryInputHandlerCB)
if not self.conf.inputbug:
# Register our sometimes buggy widget handler
self.metarQueryInputHandlerCB = self.metarQueryInputHandler
XPAddWidgetCallback(self, self.metarQueryInput, self.metarQueryInputHandlerCB)

# Register our widget handler
self.metarWindowHandlerCB = self.metarWindowHandler
Expand All @@ -1195,10 +1196,7 @@ def metarQueryInputHandler(self, inMessage, inWidget, inParam1, inParam2):
''' Override texfield keyboard input to be more friendly'''
if inMessage == xpMsg_KeyPress:

if not self.conf.inputbug:
key, flags, vkey = PI_GetKeyState(inParam1)
else:
key, flags, vkey = PI_GetKeyState(ctypes.c_uint32(inParam1).value)
key, flags, vkey = PI_GetKeyState(inParam1)

if flags == 8:
buff = []
Expand Down

0 comments on commit d947eb3

Please sign in to comment.