I am programming a virtual keyboard, where I will type by clicking with the mouse. In python2.7 interface qt4 I was able to solve the idea a lot, I could always make it appear, and also make it type in any other window .. The problem is that it is only typing when I click on an input from another window, only after typing. I need it to keep the focus false, even if it clicks on it and the other windows have focus control. Is it possible?
PS the code
from PyQt4 import QtGui, uic, QtCore
from PyQt4.QtCore import *
import pyautogui
import time
form_class = uic.loadUiType("Form1.ui")[0]
class MyWindowClass(QtGui.QMainWindow, form_class):
def __init__(self, parent=None):
QtGui.QMainWindow.__init__(self, parent, QtCore.Qt.WindowStaysOnTopHint)
self.setupUi(self)
#
self.btn1.clicked.connect(self.btn1_clicked)
#self.btnEntrar.clicked.connect(self.btnEntrar_clicked)
#self.btnEntrar2.clicked.connect(self.btnEntrar2_clicked)
def btn1_clicked(self):
#print "teste"
time.sleep(5)
pyautogui.typewrite("Teste 1, 2, 3...")