From 045a48cd1e1eec26a57cf5aaf7e3249f0e28f1de Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Sat, 24 Nov 2018 17:41:31 -0800 Subject: [PATCH] STF: Apple Left/Right as Home/End. Fixes #4 --- desk.acc/show.text.file.s | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/desk.acc/show.text.file.s b/desk.acc/show.text.file.s index 4edbce2..c62d4b0 100644 --- a/desk.acc/show.text.file.s +++ b/desk.acc/show.text.file.s @@ -516,17 +516,26 @@ title: jsr on_title_bar_click beq no_mod ;; Modifiers - ;; TODO: Should Apple-Up/Down be Page Up/Down or Home/End? lda event_params::key - cmp #CHAR_DOWN + cmp #CHAR_DOWN ; Apple-Down = Page Down bne :+ jsr page_down jmp input_loop -: cmp #CHAR_UP +: cmp #CHAR_UP ; Apple-Up = Page Up bne :+ jsr page_up + jmp input_loop + +: cmp #CHAR_LEFT ; Apple-Left = Home + bne :+ + jsr scroll_top + jmp input_loop + +: cmp #CHAR_RIGHT ; Apple-Right = End + bne :+ + jsr scroll_bottom : jmp input_loop @@ -717,6 +726,14 @@ end: rts end: rts .endproc +.proc scroll_top + lda winfo::vthumbpos + beq end + copy #0, updatethumb_params::thumbpos + jsr update_scroll_pos +end: rts +.endproc + vscroll_max := $FA .proc on_vscroll_below_click @@ -762,6 +779,15 @@ end: rts end: rts .endproc +.proc scroll_bottom + lda winfo::vthumbpos + cmp #vscroll_max + beq end + copy #vscroll_max, updatethumb_params::thumbpos + jsr update_scroll_pos +end: rts +.endproc + .proc update_scroll_pos ; Returns with carry set if mouse released jsr update_voffset jsr update_vscroll