ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] Command to make ratpoison press down-arrow.


From: jbaber
Subject: Re: [RP] Command to make ratpoison press down-arrow.
Date: Wed, 9 Sep 2009 06:21:44 -0400
User-agent: Mutt/1.5.19 (2009-01-05)

  You can also try 'xte'.  It's very easy to use for scripts and allows
direct access to 'xtest' which is what ratpoison uses for mouseclicks,
etc.

On Wed, Sep 09, 2009 at 07:16:34AM +0200, Martin wrote:
> address@hidden @ 2009-08-27 (Thursday), 12:06 (-0400)
>
> > If I want it to type some text, I've tried messing with putsel and
> > getsel, but that doesn't work for special characters like down-arrow
> > or esc.
> >
> >   Any ideas?
>
> If I understand you correctly, the command meta is what you are
> looking for. I'm using it in combination with the small shell script
> posted below. Please note that this script is only an ugly hack that
> can only be seen as inspiration. E.g. it is written for a Swedish
> keyboard mapping and will have to be adapted if used with US keyboards
> where brackets are on their own keys instead of supershifts of the
> regular parenthesis.
>
> #!/bin/zsh
> #
> # rattype
>
> function do_type() { for ((i = 1; i <= ${#1}; i++)) {
> KEYCODE="${1[$i,$i]}" KEYCODEVAL=$[ ##$KEYCODE ] [ $KEYCODEVAL -gt 64
> -a $KEYCODEVAL -lt 91 ] && KEYCODE=S-$KEYCODE [ $KEYCODEVAL -eq 32 ]
> && KEYCODE="space" [ $KEYCODEVAL -eq 40 ] && KEYCODE="S-parenleft"
> [ $KEYCODEVAL -eq 41 ] && KEYCODE="S-parenright" [ $KEYCODEVAL -eq
> 44 ] && KEYCODE="comma" [ $KEYCODEVAL -eq 46 ] && KEYCODE="period" [
> $KEYCODEVAL -eq 47 ] && KEYCODE="S-slash" [ $KEYCODEVAL -eq 45 ] &&
> KEYCODE="minus" [ $KEYCODEVAL -eq 58 ] && KEYCODE="S-colon"
>
>               echo $KEYCODEVAL $RATPOISON --command "meta $KEYCODE" }
> }
>
> [ "$1" = "--command" ] && do_type address@hidden || do_type "$@"
>
>
> ______________________________________________________________________
> Ratpoison-devel mailing list address@hidden
> http://lists.nongnu.org/mailman/listinfo/ratpoison-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]