how to use matchbox keyboard using subprocess in raspberry pi? - subprocess

I want to run my code on raspberry pi which has a touchscreen attached to it. The GUI is made using pyqt5 and I want to pop up the system onscreen keyboard when the entry is focused.
tried many things but didn't get how to use this.

my problem is solved, this is for the future in case anyone has doubt in pyqt, you can use qlineedit selectionchanged object, for eg. mobile_entry.selectionChanged.connect(self.create_keyboard). and in create keyboard function you should do this >> subprocess.Popen(["onboard"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

Related

Is there a way to use the display preview option in the display block to display the output of wired connections in EV3?

I'm trying to see if there's a way to use the display block in EV3 as a basic print function. I'm working from home and don't have a brick to test the code with so was hoping to just use the display preview option to output variables but I haven't been able to find a way. It will only show the standard 'Wired_1FAC2752-7229-46'. I've tried putting a wait block after it, putting it in a loop and clearing the display first but the preview never displays anything.
Thanks in advance
What about trying a "virtual" brick to run your programm?
Have a look at the "Virtual Robotics Toolkit": https://www.virtualroboticstoolkit.com/
It's not perfect and its not free but maybe a good workaround if you don't have any hardware at Home.

How can I make an OS X application unfocusable while still receiving click events?

I'm developing an on screen keyboard application for OS X, similar to the one that's built in to the operating system (Keyboard Viewer). I seem to have hit a wall as I'm not sure how I can accept click events from buttons and not steal focus from the currently activated application. I know this is possible since there are apps that already do this, e.g. AssistiveWere's KeyStrokes.
So my question is this: How can I make my window receive mouse events and handle them without getting activated?
P.S. I'm not very experienced in OS X development and this is my first Swift project, so excuses if this is a trivial problem.
You need to make your window an instance of NSPanel (or a subclass), include NSNonactivatingPanelMask in its styleMask, and set becomesKeyOnlyIfNeeded to true. (The style mask can be controlled in IB.) You probably also want it to be floating so it's always above normal windows, so set floatingPanel to true, too.

Weston : Customize composition to duplicate window display

I want to be able to duplicate a window at the compositor/window manager level.
That is, when the user open a weston-terminal, I want to display it as 2 windows, and be able to apply movement/rotation to those windows.
To emphasize, I don't want to have 2 weston-terminal open, I really need to duplicate the window's content on screen.
Is that possible with weston and where should I look in the code?
I already compiled it and learned to rotate/move windows using weston-shell.c but don't know where to look after.
This isn't possible with the Weston implementation, in the manner you've described. You'd have to hack your own Weston implementation to do this, such that one client can bind to multiple surfaces.
An alternative to consider is to have a surface and subsurface, and have you client render to both the main surface and the subsurface.

How to know programmatically if Smartpad Emergency stop is pressed?

I have a machine with a lot of emergency buttons and for each one I have a signal to the PLC saying it is pressed. So I know which button is pressed.
I also have a KRC4 on the security and I do not have any signal from it to the PLC saying that it's emergency is pressed.
I could go by elimination, if none was pressed, so the robot is. But is not the best option because maybe I just have wire from the buttons disconnected and I will assume that is the robot that is in emergency.
I was thinking about getting a system variable that says it is pressed, but I could not find one. Does someone know how to know if the emergency is pressed programmatically?
maybe this helps:
The following predefined data lists exist in the KR C...:
$MACHINE.DAT
is a predefined data list with exclusively predefined system variables. The machine data
serve the purpose of adapting the controller to the connected robot (kinematic
information, control parameters, etc.). There is a $MACHINE.DAT in both the control
system and the robot system. You cannot create new variables or delete existing ones.
Examples:
$ALARM_STOP Signal for Emergency Stop (controller--specific)
Select (assuming that you have 'English' as selected language) Display-> Input/Outputs->External Automatic. This will open up a window where you can connect almost any event or state in the controller to one of the outputs that you have mapped to your PLC. The events or states are more or less self explanatory. Select one and press Configure and Edit to change the output from a default value to the one you desire.
There is no need for a restart afterwards. Just close the wizard and you are good to go. This is also where you can set up inputs for a remote start of the robot. Post a question if you need more details on this topic. Good luck!

Controlling the mouse on the desktop with pywinauto

I am attempting to take control of mouse events on the desktop using pywinauto. Specifically, I am looking to make different applications active by sending a mouse click to their windows, and ideally to be able to move windows with well known title bar coordinates around.
I've tried doing app.connect_() calls to both "explorer" and "dwm" but with the exception of a DialogWrapper with the class "Progman" I've had no joy. Searching about with SWAPY has yielded similarly poor results.
I'm not a Windows programmer so I hope I'm missing something fairly obvious here. Any hints would be well received.
Thanks
Below is some code that will click on the desktop at (900, 50) using pywinauto.
Note that using ClickInput() rather than Click() is important.
import pywinauto.application
app = pywinauto.application.Application()
comapp = app.connect_(path = "explorer")
for i in comapp.windows_():
if "Progman" == i.FriendlyClassName():
i.ClickInput(coords=(900, 50))