mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-12 15:44:05 +09:00
zfm: fix: z key not working
This commit is contained in:
@@ -142,7 +142,7 @@ while (!stopPlay && seqread.getReadCount() < FILE_SIZE && readLength > 0) {
|
|||||||
|
|
||||||
|
|
||||||
if (repeat > 1) sys.sleep(10)
|
if (repeat > 1) sys.sleep(10)
|
||||||
|
|
||||||
printPlayBar()
|
printPlayBar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const EXEC_FUNS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let windowMode = 0 // 0 == left, 1 == right
|
let windowMode = 0 // 0 == left, 1 == right
|
||||||
let windowFocus = 0 // 0,2: files panel, 1: operation panel, -1: a wild popup message appeared
|
let windowFocus = 0 // 0: files window, 1: palette window, 2: popup window
|
||||||
|
|
||||||
// window states
|
// window states
|
||||||
let path = [["A:"], ["A:"]]
|
let path = [["A:"], ["A:"]]
|
||||||
@@ -301,11 +301,6 @@ let filenavOninput = (window, event) => {
|
|||||||
if (keyJustHit && keysym == "q") {
|
if (keyJustHit && keysym == "q") {
|
||||||
exit = true
|
exit = true
|
||||||
}
|
}
|
||||||
else if (keyJustHit && keysym == 'z') {
|
|
||||||
windowMode = 1 - windowMode
|
|
||||||
windowFocus = 2 - windowFocus
|
|
||||||
redraw()
|
|
||||||
}
|
|
||||||
else if (keysym == "<UP>") {
|
else if (keysym == "<UP>") {
|
||||||
[cursor[windowMode], scroll[windowMode]] = win.scrollVert(-1, dirFileList[windowMode].length, LIST_HEIGHT, cursor[windowMode], scroll[windowMode], 1)
|
[cursor[windowMode], scroll[windowMode]] = win.scrollVert(-1, dirFileList[windowMode].length, LIST_HEIGHT, cursor[windowMode], scroll[windowMode], 1)
|
||||||
drawFilePanel()
|
drawFilePanel()
|
||||||
@@ -427,7 +422,7 @@ function drawTitle() {
|
|||||||
|
|
||||||
function drawFilePanel() {
|
function drawFilePanel() {
|
||||||
windows[0].forEach((panel, i)=>{
|
windows[0].forEach((panel, i)=>{
|
||||||
panel.isHighlighted = (i == windowFocus)
|
panel.isHighlighted = (i == 2 * windowMode)
|
||||||
})
|
})
|
||||||
if (windowMode) {
|
if (windowMode) {
|
||||||
RIGHTPANEL.drawContents()
|
RIGHTPANEL.drawContents()
|
||||||
@@ -475,14 +470,23 @@ let firstRunLatch = true
|
|||||||
while (!exit) {
|
while (!exit) {
|
||||||
input.withEvent(event => {
|
input.withEvent(event => {
|
||||||
|
|
||||||
if ((1 == event[2]) && event[3] != 66) { // release the latch right away if the key is not Return
|
let keysym = event[1]
|
||||||
|
let keyJustHit = (1 == event[2])
|
||||||
|
|
||||||
|
if (keyJustHit && event[3] != 66) { // release the latch right away if the key is not Return
|
||||||
firstRunLatch = false
|
firstRunLatch = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((1 == event[2]) && firstRunLatch) { // filter out the initial ENTER key as they would cause unwanted behaviours
|
if (keyJustHit && firstRunLatch) { // filter out the initial ENTER key as they would cause unwanted behaviours
|
||||||
firstRunLatch = false
|
firstRunLatch = false
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
if (keyJustHit && keysym == 'z') {
|
||||||
|
windowMode = 1 - windowMode
|
||||||
|
redraw()
|
||||||
|
}
|
||||||
|
|
||||||
windows[windowFocus].forEach(it => {
|
windows[windowFocus].forEach(it => {
|
||||||
if (it.isHighlighted) {
|
if (it.isHighlighted) {
|
||||||
it.processInput(event)
|
it.processInput(event)
|
||||||
|
|||||||
Reference in New Issue
Block a user