Author Topic: Keyboard input via a shortcut  (Read 1195 times)

Offline Alexey931

  • Sr. Member
  • ****
  • Posts: 271
Keyboard input via a shortcut
« on: February 16, 2011, 10:22:42 AM »
Hi,

I'd like to fire a sequence of characters into an edit window using a shortcut.

Probably I have to put something into ~/.config/openbox/lxde-rc.xml, like this:
Quote
    <keybind key="A-j">
        <action name="A Burst">...? ? ?...</action>
      </keybind>
What the proper action must be? Suppose I want to fire a sequence like this: "~---~"

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1194
Re: Keyboard input via a shortcut
« Reply #1 on: February 17, 2011, 01:50:59 PM »
Hi Alexey931,

only an idea:

create a file where you save your sequence of characters.

than a small shell script

Code: [Select]
#!/bin/bash
paste <path to sequence file>

you have to do the file executable. use the right click menu > Properties > second tab > the little checkbox

naow i would try to insert the path to the shell script into the lxde-rc.xml file.

e.g.
Code: [Select]
<keybind key="A-j">
        <action name="A Burst">/home/<user name>/scripts/<file name>.sh</action>
      </keybind>

again it is an idea only

i don't know whether it works. i couldn't test it.

greets
ghostbunny
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline Alexey931

  • Sr. Member
  • ****
  • Posts: 271
Re: Keyboard input via a shortcut
« Reply #2 on: February 19, 2011, 10:55:09 PM »
Thanks!

Do you mean this paste? You are suggesting that the (focused) edit window is designed to accept standard output, if I read it correctly. Is that really so?

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1194
Re: Keyboard input via a shortcut
« Reply #3 on: February 21, 2011, 02:44:50 AM »
Do you mean this paste?


Yes, i meant this.

You are suggesting that the (focused) edit window is designed to accept standard output, if I read it correctly. Is that really so?


I'm not sure. I'm only a noob with an idea xD

I would suggest you to try it out. The workload isn't very high.

greets
ghostbunny

PS: Why don't you use control+c and control+v?
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline Alexey931

  • Sr. Member
  • ****
  • Posts: 271
Re: Keyboard input via a shortcut
« Reply #4 on: March 01, 2011, 12:28:16 PM »
PS: Why don't you use control+c and control+v?

It's a set of snippets, to be used frequently and at random.

The answer to my questions buried somewhere down here,http://www.shallowsky.com/software/crikey/ but I haven't found it yet :( (The Openbox example won't work).
« Last Edit: March 01, 2011, 12:41:04 PM by Alexey931 »

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1194
Re: Keyboard input via a shortcut
« Reply #5 on: March 02, 2011, 05:29:19 AM »
mmhhh did you install the Crikey-package from source code? without the package it won't work.

i didn't found the package in the repo. Maybe you could post it in the package suggest section.

greets
ghostbunny
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


uncleV

  • Guest
Re: Keyboard input via a shortcut
« Reply #6 on: March 02, 2011, 05:38:36 AM »
I am not sure what do you need but this
Quote
[uncleV@localhost ~]$ echo ~---~ | leafpad
added the string to a new file in the editor leafpad.

Doing this with an existing file
Quote
[uncleV@localhost ~]$ echo ~---~ | leafpad existing_file
simply opens the file without altering it.
« Last Edit: March 02, 2011, 05:40:54 AM by uncleV »

Offline Alexey931

  • Sr. Member
  • ****
  • Posts: 271
Re: Keyboard input via a shortcut
« Reply #7 on: March 03, 2011, 10:21:35 AM »
mmhhh did you install the Crikey-package from source code? without the package it won't work.

i didn't found the package in the repo. Maybe you could post it in the package suggest section.

greets
ghostbunny
Thanks, ghostbunny! I did install crikey from source code - on one box, and kept on testing it on another  ;D . As a matter of fact, it works fine.

Package suggestion is in order. A how-to without an official package is against the rules.