MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / onChar

Method onChar

gui/builtinContextMenus/itemAmountChange.py:133–142  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

131 # checks to make sure it's valid number
132 @staticmethod
133 def onChar(event):
134 key = event.GetKeyCode()
135
136 acceptable_characters = "1234567890"
137 acceptable_keycode = [3, 22, 13, 8, 127] # modifiers like delete, copy, paste
138 if key in acceptable_keycode or key >= 255 or (key < 255 and chr(key) in acceptable_characters):
139 event.Skip()
140 return
141 else:
142 return False

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected