Creating a 'Keyboard Manager' Program Using Command Line

Asked by Julianloui on 2012-10-27

------------------------------------------------------------------------------------------------------------
>> Please note: This Question is intended to replace my previous Question #210570, which was not worded very explicitly.
------------------------------------------------------------------------------------------------------------

A few years ago I purchased a very useful program known as Keyboard Manager for my Windows XP computer. It enables the user to assign various functions to multiple keyboard key combinations in order to activate applications or to reproduce a text string or even a body of text automatically.

A key combination consists of one or more keys, not already used by the operating system. Examples are "Alt + Q" and "Shift + Ctrl + K". When the user presses a key combination, the program activates the corresponding, user-assigned function. One example is to cause the computer to produce a useful text string, such as a password or a wireless-network key, or even a line of HTML code.

I would like to find out if and how I can do something similar using the Linux Command Line Interpreter (CLI). For simplicity, I prefer to use CLI instead of BASIC or C or some other programming language if possible. Any advice or help would be much appreciated.

Julianloui

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Warren Hill
Solved:
2012-10-31
Last query:
2012-10-31
Last reply:
2012-10-31

You can use ccsm to assign commands to shortcuts (assuming you are wanting to make shortcuts for GUI based things

Julianloui (julianloui) said : #2

Andrew,

I don't think this will solve my problem as I've previously responded to similar advice on my Question # 210570. CCSM is too complicated for what I need to do. At the moment, I only want to be able to use CLI to enable me to use a keyboard key combination to reproduce a simple text string in order to save work. Thank you very much.

Julianloui

Best Warren Hill (warren-hill) said : #3

Julian,

I can't see a simple way to do this in Linux. I wrote a few programs that did something similar back in the days of DOS but the Unix security model would probably get it the way.

What I did was take over the keyboard interrupt and look for keyboard combinations I was interested in If it wasn't one I cared about I just passed control back to the original interrupt but if it was I could do something else like write a different string to the keyboard buffer.

Many pop-up programs of the day worked in a similar way but this would not be the correct approach on a multi-tasking OS such as Unix/Linux.

Julianloui (julianloui) said : #4

Thanks Warren Hill, that solved my question.