I was trying to do this myself and ended up going a different way. I have
done this with xdotool and a perl wrapper that allows me to re-map some
keys and use the xdotool commands to do special key combinations and even
mouse basic movements. I had all kinds of plans to do stuff with this but
when I added the feature to hit CODE+/ and could enter in the xdotool
keywords to do anything I sort of lost momentum. Not to mention I switched
directions and started playing with an adafruit bluefruit EZ-key for serial
to BT connectivity. I thought the hardware version would be more useful for
typing on anything that could accept BT Keyboard's.

The perl script is below for inspiration and here is a link to a video of
me using it:
https://www.youtube.com/watch?v=GIv831sT50w

#Simple Perl script to send keypresses from CLI to xdtool
#Brian Brindle July, 2021

use warnings;
use strict;
use Glib;
use Glib qw/TRUE FALSE/;
use Term::ReadKey;
$|++;

#$SIG{'INT'} = 'IGNORE';   #Ignore Ctrl-C for testing - Ctrl-C remapped to
GRPH-C
$ENV{'DISPLAY'} = ':0.0';  # Set X-display

ReadMode('cbreak'); #read single char

my $main_loop = Glib::MainLoop->new;

Glib::Idle->add(
        sub{
            my $char;
            if (defined ($char = ReadKey(0)) ) {    #ReadKey(0) - use 1 for
non-blocking (Return undef)
             if (ord($char) == 10) { print "[RETURN->]\n"; qx (xdotool key
Return); }
             elsif  (ord($char) == 30) { print "[UP->]\n"; qx (xdotool key
Up); }
             elsif  (ord($char) == 31) { print "[DOWN->]\n"; qx (xdotool
key Down); }
             elsif  (ord($char) == 29) { print "[LEFT->]\n"; qx (xdotool
key Left); }
             elsif  (ord($char) == 28) { print "[RIGHT->]\n"; qx (xdotool
key Right); }
             elsif  (ord($char) == 132) { print "[CTRL-C->]\n"; qx (xdotool
key ctrl+c); } #GRPH + C
             elsif  (ord($char) == 1) { print "[MOUSE LEFT]\n"; qx (xdotool
mousemove_relative --polar  270 10); }
             elsif  (ord($char) == 6) { print "[MOUSE RIGHT]\n"; qx
(xdotool mousemove_relative --polar  270 10); }
             elsif  (ord($char) == 20) { print "[MOUSE UP]\n"; qx (xdotool
mousemove_relative --polar  0 10); }
             elsif  (ord($char) == 2) { print "[MOUSE DOWN]\n"; qx (xdotool
mousemove_relative --polar  180 10); }
             elsif  (ord($char) == 34) { print "[QUOTATION]\n"; qx (xdotool
key 0x0ad3); }
             #CODE+/ for xdotool keyword input for complex key
combinations
             elsif  (ord($char) == 174) { print "INPUT KEYS:"; my $keyin =
<STDIN>;chomp $keyin; qx (xdotool key "$keyin"); }
   else {
          print "$char-> chr\$(", ord($char),")\n";
                # Action wtih key presses here:
               qx (xdotool type "$char");
}
    }
          return TRUE; #Loop
          });

$main_loop->run;
ReadMode('normal'); # restore normal tty settings
__END__

On Sun, Sep 11, 2022 at 8:08 PM B 9 <hacke...@gmail.com> wrote:

> On Wed, Sep 7, 2022 at 5:43 AM Hiraghm <hira...@hotmail.com> wrote:
>
>> This is probably a dumb question, maybe even one that was asked/answered
>> long ago, but...
>>
>> would it be possible to use a model 100/102/200 as a keyboard for a
>> Linux workstation via "inputattach"?
>>
>
> Yes, inputattach would work fine, but this seems like a peculiar request
> and has me curious what you are doing. Is this to work with an emulator on
> the Linux workstation?  Do you have a Model 100 with no screen? Are you so
> used to the Model 100 keyboard layout that switching to this new-fangled
> IBM keyboard layout doesn't seem worth it?
>
> Actually, now that I think on it, that last point is not such a bad idea.
> I have a DEC VT-340 serial terminal which uses the LK-201 keyboard that
> inspired IBM's AT keyboard layout. I cannot stand the placement of the CTRL
> key and it doesn't even have a proper Esc key. However, if I had a Model
> 100 I could plug it directly into the VT-340's keyboard port (which I
> believe speaks 600 baud RS-232) and it'd make a dandy keyboard. And, a
> Model 100 would fit better on my desk tha DEC's huge, honkin' keyboard with
> all sorts of wacky "application editing" keys. Now, I just need to find a
> Model 100/102 with a defunct screen!
>
> —b9
>

Reply via email to