[email protected] @ 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 `...@#--command}`
[ "$1" = "--command" ] || do_type "$@"


_______________________________________________
Ratpoison-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/ratpoison-devel

Reply via email to