basicViewerPython.py
def keyPressEvent(self, e):
        """The Qt window has been sent keyboard input, which we send to the
        Server.
        """

        # A mapping between the Qt non-printable keys and the SDK keysyms
        key_map = {
            int(QtCore.Qt.Key_Escape): vncsdk.Keyboard.XK_Escape,
            int(QtCore.Qt.Key_Return): vncsdk.Keyboard.XK_Return,
            int(QtCore.Qt.Key_Enter): vncsdk.Keyboard.XK_KP_Enter,
            int(QtCore.Qt.Key_Insert): vncsdk.Keyboard.XK_Insert,
            int(QtCore.Qt.Key_Delete): vncsdk.Keyboard.XK_Delete,
            int(QtCore.Qt.Key_Pause): vncsdk.Keyboard.XK_Pause,
            int(QtCore.Qt.Key_Print): vncsdk.Keyboard.XK_Print,
            int(QtCore.Qt.Key_SysReq): vncsdk.Keyboard.XK_Sys_Req,
            int(QtCore.Qt.Key_Home): vncsdk.Keyboard.XK_Home,
            int(QtCore.Qt.Key_End): vncsdk.Keyboard.XK_End,
            int(QtCore.Qt.Key_Left): vncsdk.Keyboard.XK_Left,
            int(QtCore.Qt.Key_Up): vncsdk.Keyboard.XK_Up,
            int(QtCore.Qt.Key_Right): vncsdk.Keyboard.XK_Right,
            int(QtCore.Qt.Key_Down): vncsdk.Keyboard.XK_Down,
            int(QtCore.Qt.Key_PageUp): vncsdk.Keyboard.XK_Page_Up,
            int(QtCore.Qt.Key_PageDown): vncsdk.Keyboard.XK_Page_Down,
            int(QtCore.Qt.Key_Shift): vncsdk.Keyboard.XK_Shift_L,
            int(QtCore.Qt.Key_Alt): vncsdk.Keyboard.XK_Alt_L,

            int(QtCore.Qt.Key_F1): vncsdk.Keyboard.XK_F1,
            int(QtCore.Qt.Key_F2): vncsdk.Keyboard.XK_F2,
            int(QtCore.Qt.Key_F3): vncsdk.Keyboard.XK_F3,
            int(QtCore.Qt.Key_F4): vncsdk.Keyboard.XK_F4,
            int(QtCore.Qt.Key_F5): vncsdk.Keyboard.XK_F5,
            int(QtCore.Qt.Key_F6): vncsdk.Keyboard.XK_F6,
            int(QtCore.Qt.Key_F7): vncsdk.Keyboard.XK_F7,
            int(QtCore.Qt.Key_F8): vncsdk.Keyboard.XK_F8,
            int(QtCore.Qt.Key_F9): vncsdk.Keyboard.XK_F9,
            int(QtCore.Qt.Key_F10): vncsdk.Keyboard.XK_F10,
            int(QtCore.Qt.Key_F11): vncsdk.Keyboard.XK_F11,
            int(QtCore.Qt.Key_F12): vncsdk.Keyboard.XK_F12,
        }
        if sys.platform == 'darwin':  # Mac OS X
            key_map[int(QtCore.Qt.Key_Control)] = vncsdk.Keyboard.XK_Alt_L
            key_map[int(QtCore.Qt.Key_Meta)] = vncsdk.Keyboard.XK_Control_L
            ctrl_modifier = QtCore.Qt.MetaModifier
        else:
            key_map[int(QtCore.Qt.Key_Control)] = vncsdk.Keyboard.XK_Control_L
            key_map[int(QtCore.Qt.Key_Meta)] = vncsdk.Keyboard.XK_Super_L
            ctrl_modifier = QtCore.Qt.ControlModifier

        # Try first to send the keycode as a keysym directly, to handle non-
        # printing keycodes, which don't have associated Unicode text.
        keysym = key_map.get(e.key())
        keycode = e.key()
        if keysym:
            vncsdk.EventLoop.run_on_loop(viewer_conn.on_key_press,
                                         (keysym, False, keycode))
            return

        # Otherwise, it's presumably a Unicode key, so we should send it the
        # codepoints as Unicode keysyms.
        if e.modifiers() & ctrl_modifier:
            # If the Ctrl key is down then the result of e.text() is
            # platform-dependent, so instead we use e.keys() if it lies
            # within the printable ASCII range, otherwise we ignore the key.
            if keycode >= 0x20 and keycode <= 0x7e:
                char = chr(e.key())
                # If Shift is NOT down then we need to convert the character
                # to lowercase, otherwise the server will press Shift for us.
                if not (e.modifiers() & QtCore.Qt.ShiftModifier):
                    char = char.lower()
                vncsdk.EventLoop.run_on_loop(viewer_conn.on_key_press,
                                             (ord(char), True, keycode))
        else:
            for unichar in e.text():
                vncsdk.EventLoop.run_on_loop(viewer_conn.on_key_press,
                                             (ord(unichar), True, keycode))
The Qt window has been sent keyboard input, which we send to the
        Server.
        
The Qt window has been sent keyboard input, which we send to the
Server.
The Qt window has been sent keyboard input which we send to the Server .
def keyPressEvent(self, e):
        key_map = {
            int(QtCore.Qt.Key_Escape): vncsdk.Keyboard.XK_Escape,
            int(QtCore.Qt.Key_Return): vncsdk.Keyboard.XK_Return,
            int(QtCore.Qt.Key_Enter): vncsdk.Keyboard.XK_KP_Enter,
            int(QtCore.Qt.Key_Insert): vncsdk.Keyboard.XK_Insert,
            int(QtCore.Qt.Key_Delete): vncsdk.Keyboard.XK_Delete,
            int(QtCore.Qt.Key_Pause): vncsdk.Keyboard.XK_Pause,
            int(QtCore.Qt.Key_Print): vncsdk.Keyboard.XK_Print,
            int(QtCore.Qt.Key_SysReq): vncsdk.Keyboard.XK_Sys_Req,
            int(QtCore.Qt.Key_Home): vncsdk.Keyboard.XK_Home,
            int(QtCore.Qt.Key_End): vncsdk.Keyboard.XK_End,
            int(QtCore.Qt.Key_Left): vncsdk.Keyboard.XK_Left,
            int(QtCore.Qt.Key_Up): vncsdk.Keyboard.XK_Up,
            int(QtCore.Qt.Key_Right): vncsdk.Keyboard.XK_Right,
            int(QtCore.Qt.Key_Down): vncsdk.Keyboard.XK_Down,
            int(QtCore.Qt.Key_PageUp): vncsdk.Keyboard.XK_Page_Up,
            int(QtCore.Qt.Key_PageDown): vncsdk.Keyboard.XK_Page_Down,
            int(QtCore.Qt.Key_Shift): vncsdk.Keyboard.XK_Shift_L,
            int(QtCore.Qt.Key_Alt): vncsdk.Keyboard.XK_Alt_L,
            int(QtCore.Qt.Key_F1): vncsdk.Keyboard.XK_F1,
            int(QtCore.Qt.Key_F2): vncsdk.Keyboard.XK_F2,
            int(QtCore.Qt.Key_F3): vncsdk.Keyboard.XK_F3,
            int(QtCore.Qt.Key_F4): vncsdk.Keyboard.XK_F4,
            int(QtCore.Qt.Key_F5): vncsdk.Keyboard.XK_F5,
            int(QtCore.Qt.Key_F6): vncsdk.Keyboard.XK_F6,
            int(QtCore.Qt.Key_F7): vncsdk.Keyboard.XK_F7,
            int(QtCore.Qt.Key_F8): vncsdk.Keyboard.XK_F8,
            int(QtCore.Qt.Key_F9): vncsdk.Keyboard.XK_F9,
            int(QtCore.Qt.Key_F10): vncsdk.Keyboard.XK_F10,
            int(QtCore.Qt.Key_F11): vncsdk.Keyboard.XK_F11,
            int(QtCore.Qt.Key_F12): vncsdk.Keyboard.XK_F12,
        }
        if sys.platform == 'darwin':  
            key_map[int(QtCore.Qt.Key_Control)] = vncsdk.Keyboard.XK_Alt_L
            key_map[int(QtCore.Qt.Key_Meta)] = vncsdk.Keyboard.XK_Control_L
            ctrl_modifier = QtCore.Qt.MetaModifier
        else:
            key_map[int(QtCore.Qt.Key_Control)] = vncsdk.Keyboard.XK_Control_L
            key_map[int(QtCore.Qt.Key_Meta)] = vncsdk.Keyboard.XK_Super_L
            ctrl_modifier = QtCore.Qt.ControlModifier
        keysym = key_map.get(e.key())
        keycode = e.key()
        if keysym:
            vncsdk.EventLoop.run_on_loop(viewer_conn.on_key_press,
                                         (keysym, False, keycode))
            return
        if e.modifiers() & ctrl_modifier:
            if keycode >= 0x20 and keycode <= 0x7e:
                char = chr(e.key())
                if not (e.modifiers() & QtCore.Qt.ShiftModifier):
                    char = char.lower()
                vncsdk.EventLoop.run_on_loop(viewer_conn.on_key_press,
                                             (ord(char), True, keycode))
        else:
            for unichar in e.text():
                vncsdk.EventLoop.run_on_loop(viewer_conn.on_key_press,
                                             (ord(unichar), True, keycode))
def keyPressEvent ( self , e ) : key_map = { int ( QtCore . Qt . Key_Escape ) : vncsdk . Keyboard . XK_Escape , int ( QtCore . Qt . Key_Return ) : vncsdk . Keyboard . XK_Return , int ( QtCore . Qt . Key_Enter ) : vncsdk . Keyboard . XK_KP_Enter , int ( QtCore . Qt . Key_Insert ) : vncsdk . Keyboard . XK_Insert , int ( QtCore . Qt . Key_Delete ) : vncsdk . Keyboard . XK_Delete , int ( QtCore . Qt . Key_Pause ) : vncsdk . Keyboard . XK_Pause , int ( QtCore . Qt . Key_Print ) : vncsdk . Keyboard . XK_Print , int ( QtCore . Qt . Key_SysReq ) : vncsdk . Keyboard . XK_Sys_Req , int ( QtCore . Qt . Key_Home ) : vncsdk . Keyboard . XK_Home , int ( QtCore . Qt . Key_End ) : vncsdk . Keyboard . XK_End , int ( QtCore . Qt . Key_Left ) : vncsdk . Keyboard . XK_Left , int ( QtCore . Qt . Key_Up ) : vncsdk . Keyboard . XK_Up , int ( QtCore . Qt . Key_Right ) : vncsdk . Keyboard . XK_Right , int ( QtCore . Qt . Key_Down ) : vncsdk . Keyboard . XK_Down , int ( QtCore . Qt . Key_PageUp ) : vncsdk . Keyboard . XK_Page_Up , int ( QtCore . Qt . Key_PageDown ) : vncsdk . Keyboard . XK_Page_Down , int ( QtCore . Qt . Key_Shift ) : vncsdk . Keyboard . XK_Shift_L , int ( QtCore . Qt . Key_Alt ) : vncsdk . Keyboard . XK_Alt_L , int ( QtCore . Qt . Key_F1 ) : vncsdk . Keyboard . XK_F1 , int ( QtCore . Qt . Key_F2 ) : vncsdk . Keyboard . XK_F2 , int ( QtCore . Qt . Key_F3 ) : vncsdk . Keyboard . XK_F3 , int ( QtCore . Qt . Key_F4 ) : vncsdk . Keyboard . XK_F4 , int ( QtCore . Qt . Key_F5 ) : vncsdk . Keyboard . XK_F5 , int ( QtCore . Qt . Key_F6 ) : vncsdk . Keyboard . XK_F6 , int ( QtCore . Qt . Key_F7 ) : vncsdk . Keyboard . XK_F7 , int ( QtCore . Qt . Key_F8 ) : vncsdk . Keyboard . XK_F8 , int ( QtCore . Qt . Key_F9 ) : vncsdk . Keyboard . XK_F9 , int ( QtCore . Qt . Key_F10 ) : vncsdk . Keyboard . XK_F10 , int ( QtCore . Qt . Key_F11 ) : vncsdk . Keyboard . XK_F11 , int ( QtCore . Qt . Key_F12 ) : vncsdk . Keyboard . XK_F12 , } if sys . platform == 'darwin' : key_map [ int ( QtCore . Qt . Key_Control ) ] = vncsdk . Keyboard . XK_Alt_L key_map [ int ( QtCore . Qt . Key_Meta ) ] = vncsdk . Keyboard . XK_Control_L ctrl_modifier = QtCore . Qt . MetaModifier else : key_map [ int ( QtCore . Qt . Key_Control ) ] = vncsdk . Keyboard . XK_Control_L key_map [ int ( QtCore . Qt . Key_Meta ) ] = vncsdk . Keyboard . XK_Super_L ctrl_modifier = QtCore . Qt . ControlModifier keysym = key_map . get ( e . key ( ) ) keycode = e . key ( ) if keysym : vncsdk . EventLoop . run_on_loop ( viewer_conn . on_key_press , ( keysym , False , keycode ) ) return if e . modifiers ( ) & ctrl_modifier : if keycode >= 0x20 and keycode <= 0x7e : char = chr ( e . key ( ) ) if not ( e . modifiers ( ) & QtCore . Qt . ShiftModifier ) : char = char . lower ( ) vncsdk . EventLoop . run_on_loop ( viewer_conn . on_key_press , ( ord ( char ) , True , keycode ) ) else : for unichar in e . text ( ) : vncsdk . EventLoop . run_on_loop ( viewer_conn . on_key_press , ( ord ( unichar ) , True , keycode ) )
The Qt window has been sent keyboard input, which we send to the
Server.
The Qt window has been sent keyboard input which we send to the Server .
"""The Qt window has been sent keyboard input, which we send to the
        Server.
        """ # A mapping between the Qt non-printable keys and the SDK keysyms # Mac OS X # Try first to send the keycode as a keysym directly, to handle non- # printing keycodes, which don't have associated Unicode text. # Otherwise, it's presumably a Unicode key, so we should send it the # codepoints as Unicode keysyms. # If the Ctrl key is down then the result of e.text() is # platform-dependent, so instead we use e.keys() if it lies # within the printable ASCII range, otherwise we ignore the key. # If Shift is NOT down then we need to convert the character # to lowercase, otherwise the server will press Shift for us.
self
e