STF: Apple Left/Right as Home/End. Fixes #4

This commit is contained in:
Joshua Bell 2018-11-24 17:41:31 -08:00
parent 39581705cf
commit 045a48cd1e

View File

@ -516,17 +516,26 @@ title: jsr on_title_bar_click
beq no_mod beq no_mod
;; Modifiers ;; Modifiers
;; TODO: Should Apple-Up/Down be Page Up/Down or Home/End?
lda event_params::key lda event_params::key
cmp #CHAR_DOWN cmp #CHAR_DOWN ; Apple-Down = Page Down
bne :+ bne :+
jsr page_down jsr page_down
jmp input_loop jmp input_loop
: cmp #CHAR_UP : cmp #CHAR_UP ; Apple-Up = Page Up
bne :+ bne :+
jsr page_up 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 : jmp input_loop
@ -717,6 +726,14 @@ end: rts
end: rts end: rts
.endproc .endproc
.proc scroll_top
lda winfo::vthumbpos
beq end
copy #0, updatethumb_params::thumbpos
jsr update_scroll_pos
end: rts
.endproc
vscroll_max := $FA vscroll_max := $FA
.proc on_vscroll_below_click .proc on_vscroll_below_click
@ -762,6 +779,15 @@ end: rts
end: rts end: rts
.endproc .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 .proc update_scroll_pos ; Returns with carry set if mouse released
jsr update_voffset jsr update_voffset
jsr update_vscroll jsr update_vscroll