0

Ok Im wondering why in terminal we cannot input these commands and get the same output as the keystroke? Is it possible to some how add them to list of acceptable commands in my terminal.

Tab = Tab
Shift = Shift
Backspace = Backspace
Supr = Supr
LCtrl = LCtrl
RCtrl = RCtrl
LAlt = LAlt
RAlt = RAlt
F1-F12 = F1-F12

This would make scripting more lightweight and macros easier to develop be it they would have multiple reference points ie. referencees in keyboard shortcuts. It would make it possible for a user to do things like minimize/maximize, and hide/exit windows via commandline with out the need for added applications.

  • Ive been researching it all day and found only some obfuscated article about creating a bash script ask before down vote.. – user2218260 Oct 17 '14 at 3:20
  • It may be good for some because keys layout is different for different users and everybody use different combinations for some particular task execution. So script won't be transferable to different systems. – hunch Oct 17 '14 at 4:40
  • Well durring installation Ubuntu gathers region information just for this purpose...The US version of ubuntu should come stock with qwerty based human writable keyboard shortcuts for terminal or as I like to call them HwksFT. – user2218260 Oct 17 '14 at 4:49
1

You can accomplish what you wish using xdotool Install xdotool. For example the following Tab function will do what you asked:

Tab () { xdotool key Tab ; }

or, equivalent:

Tab () { xdotool key 23 ; }

Other examples:

LAlt () { xdotool key Alt_L ; }

or:

AltTab () { xdotool key Alt_L+Tab ; }

or:

AltTab () { xdotool key 64+23 ; }

For more info about xdotool, see man xdotool.

  • Its terrible that we need a tool for this this should be a stock functionality of linux...I feel locked out I hope the Devs will entertain the idea of keyboard shortcuts via command line as priority stock terminal function. – user2218260 Oct 17 '14 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.