(self, signal)
Input event replacements.
Input event replacements.
Input event replacements .
def _replace_inputs(self, signal):
        """Input event replacements."""
        if signal.event_type == signals.KEYB_DOWN:
            c, scan, mod = signal.params
            if (self._ctrl_c_is_break and c == uea.CTRL_c):
                # replace ctrl+c with ctrl+break if option is enabled
                signal.params = u'', scancode.BREAK, [scancode.CTRL]
            elif scan == scancode.F12:
                # F12 emulator "home key"
                self._f12_active = True
                signal.event_type = None
            elif self._f12_active:
                # F12 replacements
                if c.upper() == u'B':
                    # f12+b -> ctrl+break
                    signal.params = u'', scancode.BREAK, [scancode.CTRL]
                else:
                    scan, c = HOME_KEY_REPLACEMENTS_SCANCODE.get(scan, (scan, c))
                    scan, c = HOME_KEY_REPLACEMENTS_EASCII.get(c.upper(), (scan, c))
                    signal.params = c, scan, mod
        elif (signal.event_type == signals.KEYB_UP) and (signal.params[0] == scancode.F12):
            self._f12_active = False
def _replace_inputs ( self , signal ) : if signal . event_type == signals . KEYB_DOWN : c , scan , mod = signal . params if ( self . _ctrl_c_is_break and c == uea . CTRL_c ) : # replace ctrl+c with ctrl+break if option is enabled signal . params = u'' , scancode . BREAK , [ scancode . CTRL ] elif scan == scancode . F12 : # F12 emulator "home key" self . _f12_active = True signal . event_type = None elif self . _f12_active : # F12 replacements if c . upper ( ) == u'B' : # f12+b -> ctrl+break signal . params = u'' , scancode . BREAK , [ scancode . CTRL ] else : scan , c = HOME_KEY_REPLACEMENTS_SCANCODE . get ( scan , ( scan , c ) ) scan , c = HOME_KEY_REPLACEMENTS_EASCII . get ( c . upper ( ) , ( scan , c ) ) signal . params = c , scan , mod elif ( signal . event_type == signals . KEYB_UP ) and ( signal . params [ 0 ] == scancode . F12 ) : self . _f12_active = False