Skip to content

Commit

Permalink
Add ability to turn of box drawing characters so cut and paste works
Browse files Browse the repository at this point in the history
  • Loading branch information
horga83 committed Sep 19, 2020
1 parent a85328d commit 66594e9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .idea/h19term.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions h19-readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@

Function Keys
-------------
IL Keypad 1
DL Keypad 3
HOME Keypad 5
IC Keypad 7
DC Keypad 9

F1-F5 Same as PC keyboard
BLUE F6 key on PC
RED F7
Expand Down Expand Up @@ -122,6 +128,7 @@
Ctrl-A K Toggle the Keypad between normal and alternate mode
Ctrl-A L Toggle logging of serial data to h19term.log
Ctrl-A M Show this user manual
Ctrl-A N Toggle window box characters, for copy and paste of terminal
Ctrl-A Q CP/M Quick Help
Ctrl-A P Select serial port and baud rate
Ctrl-A R Reset the terminal to power up mode
Expand Down
31 changes: 24 additions & 7 deletions h19term.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
# May 30, 2020 V2.3 Fix window sizes on Raspberry pi/ Linux console
# and only use 16x32 font.
# Jun 01, 2020 V2.4 Added Xmodem transfer.
# Aug 22, 2020 V2.5 Add toggling window box drawing characters for Linux copy and paste.
# Add keypad associations to help screen.

import os
import re
Expand Down Expand Up @@ -151,8 +153,8 @@

# ************ END OF USER MODIFIABLE SETTINGS *****************************

VERSION = 'V2.4 - Python 3'
VERSION_DATE = 'Jun 01, 2020'
VERSION = 'V2.5 - Python 3'
VERSION_DATE = 'Aug 22, 2020'

CONFIG_FILE = os.path.join(os.environ['HOME'], '.h19termrc')
LOG_FILE = os.path.join(os.environ['HOME'], 'h19term.log')
Expand Down Expand Up @@ -540,6 +542,7 @@ def __init__(self):
self.screen = None
self.status = None
self.logio = False
self.showbox = True
self.baudrate = [110, 150, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200, 9600, 19200, 38400]

H19Screen.__init__(self, self.screen, self.status)
Expand Down Expand Up @@ -1485,11 +1488,12 @@ def popup_help(self):
H19 BREAK Key..................B | KP_ENTER..F10
H19 DEL Key....................D | ERASE.....F11
CP/M Quick Help................Q | OFFLINE...F12
Set H19term colours............C |
Set Baud Rate and Port.........P |
Send file by XMODEM............S |
Press command key or <Enter> to close help.
Set H19term colours............C | IL.......KP_1
Set Baud Rate and Port.........P | DL.......KP_3
Send file by XMODEM............S | HOME.... KP_5
Toggle window box char.........N | IC.......KP_7
| DC.......KP_9
Press command key or <Enter> to close help.
"""
try:
self.background_clear()
Expand Down Expand Up @@ -1576,6 +1580,19 @@ def parse_ctrl_a(self, sio, scr, scn, st):
self.show_ascii_file('h19-readme.txt')
break

elif s == 'n' or s == 'N': # Toggle box around window for copy paste reasons
if self.showbox:
self.cur.border(' ',' ',' ',' ',' ',' ',' ',' ')
self.showbox = False
else:
self.cur.border()
self.showbox = True
self.cur.refresh()
self.show_status_line()
self.screen.touchwin()
self.screen.refresh()
break

elif s == 'p' or s == 'P': # Set baud rate
self.popup_baud_rate(sio)
break
Expand Down

0 comments on commit 66594e9

Please sign in to comment.