gonzopi

git clone https://git.tarina.org/gonzopi
Log | Files | Refs | README | LICENSE

commit c423d287e5357b25f1712ff785f355d7ee889ae8
parent cd3555e504a7c760e496cc089ffcddb0f695f1a3
Author: rbckman <rob@tarina.org>
Date:   Mon, 29 Dec 2025 10:16:17 +0000

press a key to stop dubbing. works. DUB key for edit mode

Diffstat:
MVERSION | 2+-
Mgonzopi.py | 27++++++++-------------------
Msrv/templates/edit.html | 17++++++++++++++++-
3 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/VERSION b/VERSION @@ -1,2 +1,2 @@ -2.94 +2.95 Tarkovsky diff --git a/gonzopi.py b/gonzopi.py @@ -7528,25 +7528,14 @@ def empty(filename): def waitforanykey(): vumetermessage("press any key to continue..") time.sleep(1) - while True: - with term.cbreak(): - val = term.inkey(timeout=0) - if not val: - event = '' - elif val.is_sequence: - event = val.name - elif val: - event = val - if i2cbuttons == True: - readbus = bus.read_byte_data(DEVICE,GPIOB) - readbus2 = bus.read_byte_data(DEVICE,GPIOA) - else: - readbus = 255 - readbus2 = 247 - if readbus != 255 or readbus2 != 247 or event != '': - time.sleep(0.05) - vumetermessage(' ') - return + pressed = '' + buttonpressed = '' + buttontime = time.time() + holdbutton = '' + flushbutton() + while pressed == '': + pressed, buttonpressed, buttontime, holdbutton, event, keydelay = getbutton(pressed, buttonpressed, buttontime, holdbutton) + return def middlebutton(): with term.cbreak(): diff --git a/srv/templates/edit.html b/srv/templates/edit.html @@ -39,6 +39,8 @@ $$(document).on('keydown', function (event) { $$('#COPY').trigger('click'); } else if (event.which == 80) { $$('#PASTE').trigger('click'); + } else if (event.which == 68) { + $$('#DUB').trigger('click'); } }); </script> @@ -91,7 +93,7 @@ button { <a id="VIEW">VIEW</a> <a id="UP">UP</a> <a id="RECORD">RECORD</a><br> <a id="LEFT">LEFT</a> <a id="MIDDLE">MIDDLE</a> <a id="RIGHT">RIGHT</a><br> <a id="DELETE">DELETE</a> <a id="DOWN">DOWN</a> <a id="RETAKE">RETAKE</a><br> -<a id="MOVE">MOVE</a> <a id="COPY">COPY</a> <a id="PASTE">PASTE</a><br> +<a id="MOVE">MOVE</a> <a id="COPY">COPY</a> <a id="PASTE">PASTE</a> <a id="DUB">DUB</a> <br> </div> <div id="menu2" style="margin:0 auto; width:99%" ></div> <div id="menu" style="margin:0 auto; width:99%"> @@ -355,6 +357,19 @@ $$('#PASTE').on('click', function () { } }) }); +$$('#DUB').on('click', function () { + $$.ajax({ + method: "POST", + type: "Content-type", + url:"/api?func=dub", + success: function(result) { + }, + error: function(result) { + console.log('error', result); + } +}) +}); + // Function to fetch data and update div function updateShotData() {