Re: [M100] M100 Linux keyboard via inputattach?

2022-09-12 Thread Brian Brindle
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 =
;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  wrote:

> On Wed, Sep 7, 2022 at 5:43 AM Hiraghm  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
>


Re: [M100] TRS-80 Model 100 termcap

2022-09-12 Thread Jesse Lafleur
Thank you for this

On Sun., Sep. 11, 2022, 4:36 p.m. Wayne Lorentz,  wrote:

> Recently on this list, someone asked about a termcap definition for the
> Model 100.
>
> I’ve been cobbling together bits and pieces over the years, and this is
> what I use to telnet into my Mac media server, and from there ssh, gopher,
> and lynx out into the world.
>
> If you’re going to use a Mac as a middle man, be sure to set your TRS-80
> user to use bash, instead of zsh.  Zsh adds a bunch of superfluous control
> characters to the command prompt that show up as garbage on a Model 100.
> It’s a known issue, but nobody seems interested in fixing it because modern
> terminals just ignore it.
>
> termcap.text:
>
> trs80-100|TRS-80 Model 100 v2,
> lines#8, has_status_line@,
> columns#40, init_tabs#8,
> init_1string=\EU,
> init_2string=\EW\Eq\EE,
> auto_left_margin,auto_right_margin,
> backspaces_with_bs,
> dest_tabs_magic_smso, xon_xoff,
> bell=^G, carriage_return=^M,
> clr_eol=\EK, clr_eos=\EJ,
> cursor_address=\EY%p1%' '%+%c%p2%' '%+%c,
> cursor_up=\EA,
> cursor_down=\EB,
> cursor_right=\EC,
> cursor_left=\ED,
> clear_screen=\EE,
> cursor_home=\EH,
> insert_line=\EL,
> delete_line=\EM,
> cursor_normal=\EP,
> cursor_invisible=\EQ,
> dis_status_line=\EU\EY0 \ES\EM,
> enter_reverse_mode=\Ep,
> enter_standout_mode=\Ep,
> exit_standout_mode=\Eq,
> exit_attribute_mode=\Eq,
> key_backspace=^H, tab=^I,
> key_up=^^, key_down=^_,
> key_left=^], key_right=^\,
> newline=^M^J,
> scroll_forward=^J,
> set_attributes@,
> max_colors@,
>acs_chars=}\243.\231\,\233+\232
>  -\230h\345~\325a\377
>  f\246`\235{\210q\361
>  i\251n\372m\366
>  j\367|\212g\2150\357
>  w\363u\371t\364v\370
>  l\360k\362x\365,
>
>
> These are the shell customizations I use in my .profile:
>
> #Stop macOS from complaining about us not using the zsh shell, since zsh
> has a bug in it which causes it to spit out unnecessary control codes at
> the prompt.
>
> export BASH_SILENCE_DEPRECATION_WARNING=1
>
>
> # Change to our custom TRS-80 Model 100 terminal definition.
>
> export TERM=trs80-100
>
>
> # Set the terminal to full duplex.
>
> /bin/stty echo
>
>
> # Tell the terminal to send us ASCII text only.
>
> export LANG=C
>
>
> # Tell the terminal to use Control-S/Control-Q flow control
>
> stty ixon ixoff -ixany
>
>
> # Compensate for programs that ignore the TERMINFO variable
>
> stty rows 8 cols 40
>
>
> # Tell the terminal which character to use for backspace
>
> stty erase ^H
>
>
> # Unset the usual definition of Control-\, because the TRS-80 Model 100
> uses that for other things
>
> stty quit undef
>
>
> # Tell the terminal to interpret a carriage return as a newline character
>
> stty icrnl
>
>
> # Force man to use more for paging (which actually ends up being less in
> macOS)
>
> export MANPAGER=more
>
>
> # For some reason, man needs to be reminded of our terminal width.
> Naughty man.
>
> export MANWIDTH=40
>
>
> # Hey, we're monochrome here!
>
> export GCC_COLORS=""
>
>
> # Set our custom, very short, prompt.
>
> export PS1="\h/\W:"
>
>
> # Path stuff, which is always both a bother and a necessity.
>
> export
> PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Little\
> Snitch.app/Contents/Components
>
>
> # Set the ls command to our custom settings which make it very small on
> the TRS-80.
> # -1 Causes single column output, which is needed because filenames these
> days are often very long
> # -F Adds decorations to the ends of certain entries to indicate of
> they're a directory or executable or other things.  This is done because we
> don't have the option of color to differentiate between these items.
>
> alias ls="ls -1 -F"
>
>
> # Set htop to look better on our small screen and low refresh rate.
>
> alias htop="htop --no-color --delay=30 --no-unicode --no-mouse --readonly"
>
>
> # Set some of the lynx options to work better on our small screen and low
> refresh rate.  Other lynx settings also have to be changed within the lynx
> config file.
>
> alias lynx="lynx -accept-all-cookies=true -book -nomargins=true
> -nomore=true -noprint=true -nostatus=true -notitle=true -number_links=true
> -number_fields=true -useragent='TRS-80 Model 100 via Lynx' -width=40"
>
>
> # Tell newsboat to stop telling us all its little progress updates.
>
> alias newsboat="newsboat --quiet"
>
>
> # Customization for nano.
>
> alias nano="nano -Opx"
>
>
> # Tell the w3m browser that we're monochrome
>
> alias w3m="w3m -color=0"
>
>
> export PATH="/opt/homebrew/sbin:$PATH”
>
>
> —:—
>
> The most annoying thing is the way Lynx keeps sending you information you
> don’t need.  On a high-speed