(self, keystr)
Set KEY trigger to chr(modcode)+chr(scancode).
Set KEY trigger to chr(modcode)+chr(scancode).
Set KEY trigger to chr ( modcode ) + chr ( scancode ) .
def set_trigger(self, keystr):
        """Set KEY trigger to chr(modcode)+chr(scancode)."""
        # only length-2 expressions can be assigned as scancode triggers
        if len(keystr) != 2:
            raise error.BASICError(error.IFC)
        # can't redefine scancodes for predefined keys 1-14 (pc) 1-16 (tandy)
        if not self._predefined:
            # from modifiers, exclude scroll lock at 0x10 and insert 0x80.
            self._modcode = bytearray(keystr)[0] & 0x6f
            self._scancode = bytearray(keystr)[1]
            # all shifts are equal
            if self._modcode & 3:
                self._modcode |= 3
def set_trigger ( self , keystr ) : # only length-2 expressions can be assigned as scancode triggers if len ( keystr ) != 2 : raise error . BASICError ( error . IFC ) # can't redefine scancodes for predefined keys 1-14 (pc) 1-16 (tandy) if not self . _predefined : # from modifiers, exclude scroll lock at 0x10 and insert 0x80. self . _modcode = bytearray ( keystr ) [ 0 ] & 0x6f self . _scancode = bytearray ( keystr ) [ 1 ] # all shifts are equal if self . _modcode & 3 : self . _modcode |= 3