I am currently trying to create a PyQt5 application that sends OSC messages to ETC's EOS lighting software. I have a single encoder wheel working to modify the pan values of a moving light. However, I don't want the PyQt5 application to be activated and take focus away from the EOS software. I want to be able to click and drag the encoder wheel I created and then immediately have EOS still active so I can use the keyboard shortcuts for recording commands, setting intensity or other values, etc. I am struggling to find a way to make the PyQt5 application not take focus/activation when clicking and dragging the Dial widget. I have looked everywhere I can find to try and solve this issue and I know about "setWindowsFlags" for PyQt5, but they don't accomplish what I am trying to solve. My best guess is that the windows flags are being set for the window and/or widgets, but not for the application as a whole. Is there a way to do this? Is there some other Python module out there that can help me accomplish this?

Here is a portion of the code I have for creating the dial widget

from PyQt5 import QtCore
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import sys

class Dial(QDial):

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.setNotchesVisible(False)
        self.setWrapping(True)
        self.setRange(0, 25)
        self.valueChanged.connect(self.emitValueChanged)
        self.setWindowFlags(Qt.WindowDoesNotAcceptFocus)
    
    @property
    def dialVal(self):
        return self.value()

    def emitValueChanged(self, dialVal):
        print(self.value())

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowFlags( Qt.Window | Qt.FramelessWindowHint | Qt.WindowDoesNotAcceptFocus | Qt.WindowStaysOnTopHint)
        self.setAttribute(Qt.WA_ShowWithoutActivating)
        self.setFocusPolicy(Qt.NoFocus)
        self.dial = Dial()
    
        layout = QVBoxLayout(self)
        layout.addWidget(self.dial)
        self.setCentralWidget(self.dial)

app = QApplication(sys.argv)
screen = MainWindow()
screen.show()
sys.exit(app.exec_())
0

There are 0 answers