コード例 #1
0
def focusChanged(lostFocus, hasFocus):
    hasFocusType = type(hasFocus)
    if hasFocus is None or hasFocusType != X11Embed: # for e.g. focus is out from application, or is another widget
        keyG = QWidget.keyboardGrabber()  # find keyboardGrabber and releaseKeyboard
        if keyG is not None:
            keyG.releaseKeyboard()
    elif hasFocusType == X11Embed:
        hasFocus.grabKeyboard()
コード例 #2
0
ファイル: main.py プロジェクト: whande1992/myrdp
def focusChanged(lostFocus, hasFocus):
    hasFocusType = type(hasFocus)
    if hasFocus is None or hasFocusType != X11Embed:  # for e.g. focus is out from application, or is another widget
        keyG = QWidget.keyboardGrabber(
        )  # find keyboardGrabber and releaseKeyboard
        if keyG is not None:
            keyG.releaseKeyboard()
    elif hasFocusType == X11Embed:
        hasFocus.grabKeyboard()
コード例 #3
0
 def leaveEvent(self, event):
     keyG = QWidget.keyboardGrabber()
     if keyG is not None:
         keyG.releaseKeyboard()
     event.accept()  # needed?
コード例 #4
0
ファイル: mainwindow.py プロジェクト: szatanszmatan/myrdp
 def leaveEvent(self, event):
     keyG = QWidget.keyboardGrabber()
     if keyG is not None:
         keyG.releaseKeyboard()
     event.accept()  # needed?