# Keystroke Command

Is there a way to trigger a Keystroke (e.g. CTRL + q ) using a command?
Or is it possible to write it in a script so I can run that script by pressing a button in my layout?
Been looking online for Delphi / TurboPascal scripts, but didn’t find anything usefull

I want to create a button in mAirlist wich opens the database app and make the database app stay on top at all times. Since it isn’t possible standard to have the database app run on top, I am finding a way to have this done.
There is a simple software called ‘Always on top’ wich allows you to create a script for running software ‘on top’ when starting that software. So now I want to trigger that external script using shortcut ‘CTRL + q’ by pressing a button in my layout.

Maybe also a nice request: have an option to run the database ‘always on top’ after start.

(For now some help in a command or script will do the trick for me!)

What you might want to try is to trigger some command by the keystroke, say, OPENDB (to be set up in the Remotes page in the config app). From there you can script something like

procedure OnExecuteCommand(Command: string);
begin
if Command = 'OPENDB' then
ShellExecute('C:\path\to\app.exe', '-any -parameters');
end;

begin
end.



(untested)

Unfortunattly this isn’t the right solution for me. I been trying this before and it would be easier to run a script by pressing a button in mAirlist instead of activate a command and assign a script to that command.
The button in mAirlist will NOT be triggered by a keystroke, the button will activate a keystroke. So I not want to trigger a script by a keystroke, I want a script to run a keystroke.

Your part of the ShellExecute can be intersting tough. I wonder if there is a standard parameter available for running the opened software ‘always on top’.

If it is possible just to have a script that triggers a keystroke, it would be the easiest way.

Ah, I got you wrong there.

This is all Windows commands or the software manufacturer’s business. mAirList does not deal with these but only forwards the Windows shell commands you declare.

It is running now.
I wrote a script using a ‘Always On Top’ software and compiled ithat to a working .exe file.
After that I have rewrote the script from Tondose to run the executor by a script in mAirlist. Now I do have another small issue, but that is offtopic for this.
Since the scripting is not related to mAirlist, I won’t share the always on top script here for now.

This is the Script from tondose edited to run a execurot file in a mAirlist script

ShellExecute ('C:\Software Settings\Always On Top\Open mAirlist database on top.exe', '');
end.


This script is tested and working on version 7 b5032

Fine. If some annoying windows do appear in the process, there is another command named ShellExecuteHidden you may want to use.