LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-12-2015, 01:14 AM   #1
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Rep: Reputation: 17
Custom shortcuts in Linux


I use a product called Keyboard Express in Windows. This allows me to map some key combination to some text output. So instead of filling out some text, let's say on a web page, I use the key combination to generate the text rather than have to retype it in its entirety. It's very useful for saving keystrokes.

I thought I might be able to do this in Linux with the keyboard shortcuts which various Linux desktops provide. But when I create a custom shortcut for these various desktops the text output which I provide is always interpreted as some sort of executable command in order to start a process, rather than as just text output.

Is there an equivalent in Linux which will allow me to map some keyboard shortcut to text output in order to save keystrokes when typing text ?
 
Old 10-12-2015, 01:54 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 20,772

Rep: Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056
you need to specify the environment you use. Is it (inside) a web browser or in another specific application or is it a simple terminal and you are speaking about the command line or ????
 
Old 10-12-2015, 07:58 AM   #3
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by pan64 View Post
you need to specify the environment you use. Is it (inside) a web browser or in another specific application or is it a simple terminal and you are speaking about the command line or ????
The environment is any process which accepts keyboard input. On Windows Keyboard Express translates the keyboard input from the hotkey to whatever keyboard input the hotkey specifies. Hotkeys are a single keystroke, like Alt-Shift-some-alphabetic. For instance I have Alt-Shift-i as a hotkey which generates my street address. So anytime I need to specify my street address in some Windows application which is waiting for me to type it in on the keyboard, instead of typing out my full street address I simply press alt-shift-i on my keyboard and my street address is input from the keyboard. This saves many keystrokes when I have to repetitively type in data for any given application which reads it from the keyboard. The hotkey can represent any keystroke, so I could have used just alt-i or control-i instead etc. Keyboard Express runs in the background on Windows but you can always bring it to the foreground ( it sits in the Windows system tray ) and add whatever hotkeys you want it to use.

The various Linux Window Managers ( Gnome, KDE, Unity etc. ) all have a Keyboard system setting that lets you add custom keystrokes. However all these custom keystroke are, as far as I can tell and have tried them, means to generating a command within that Windows Manager. What I want in Linux is what Keyboard Express provides under Windows: a means for taking single keystroke input and translating that into a sequence of keystrokes for any Linux process that is accepting input from the keyboard.
 
Old 10-12-2015, 08:13 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 20,772

Rep: Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056Reputation: 7056
In that case I would say you misunderstood something. You can remap keys, but actually it depends on the applications. (for example in vi or emacs you can do that easily). But if you want to do it in general you need to check xmodmap and xkeymap that works only for GUI.
xkeymap
 
Old 10-12-2015, 09:05 AM   #5
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by pan64 View Post
In that case I would say you misunderstood something. You can remap keys, but actually it depends on the applications. (for example in vi or emacs you can do that easily). But if you want to do it in general you need to check xmodmap and xkeymap that works only for GUI.
xkeymap
Actually Keyboard Express on Windows only works for GUI. It does not work at a Windows command prompt. So GUI on Linux would be fine. I will look at xmodmap and xkeymap, whose names suggest they work for any X-Windows GUI applications. Thanks for your suggestions !
 
Old 10-12-2015, 11:32 AM   #6
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,084

Rep: Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279Reputation: 2279
The normal keyboard shortcut creator will enable you to do many commands. For example, on this computer Super+1 gives
gconftool-2 -t string -s /apps/panel/applets/clock/prefs/custom_format '<span color="#ffffff"><b>R%A%e%B</b></span>'
and Super+q
wine "/home/david/.wine/drive_c/Program Files/QemuLator/QemuLator2.3.exe"

In Gnome or Mate, you need the configuration editor; I don't know about KDE. Otherwise, the tool to use is xbindkeys.
 
Old 10-12-2015, 02:57 PM   #7
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by DavidMcCann View Post
The normal keyboard shortcut creator will enable you to do many commands. For example, on this computer Super+1 gives
gconftool-2 -t string -s /apps/panel/applets/clock/prefs/custom_format '<span color="#ffffff"><b>RA%e%B</b></span>'
and Super+q
wine "/home/david/.wine/drive_c/Program Files/QemuLator/QemuLator2.3.exe"

In Gnome or Mate, you need the configuration editor; I don't know about KDE. Otherwise, the tool to use is xbindkeys.
I don't want a keyboard shortcut to do a command. Instead I want a keyboard shortcut to translate to some input string when text is being accepted in a GUI program.

I found the Linux utility called 'autokey' ( https://code.google.com/p/autokey/ ) to do what I want and will probably use that. An alternative utility I have also found is 'IronAHK' ( https://github.com/polyethene/IronAHK ). Since I am a very experienced computer programmer highly proficient with Python and C#, I will look into both.

Perhaps what I was looking for was not explained very well by the title of my OP.
 
  


Reply

Tags
keyboard, shortcut, text


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Custom Keyboard Shortcuts paulcall Linux - General 6 07-10-2013 09:14 PM
How do I add custom keyboard shortcuts in WindowMaker? linuxlicious Linux - Desktop 1 02-12-2013 01:57 AM
Creating Custom Keyboard Shortcuts in Ubuntu lifeafterdeath Linux - Newbie 4 05-13-2010 12:51 PM
KDE custom shortcuts to switch between layots ?!! slashams Debian 1 02-24-2007 04:44 PM
Custom Keyboard Shortcuts in Gnome mvanadel Linux - General 5 09-28-2003 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration