Struct for Event record

This commit is contained in:
Joshua Bell 2018-07-04 21:12:20 -07:00
parent 3b085738aa
commit c7c7d866e4
3 changed files with 31 additions and 24 deletions

View File

@ -491,9 +491,9 @@ handle_keydown:
jmp cmd_scroll
menu_accelerators:
lda event_params+1
lda event_key
sta LE25C
lda event_params+2
lda event_modifiers
beq L43A1
lda #1
L43A1: sta LE25D
@ -2667,7 +2667,7 @@ L5584: jsr get_event
bne L5584
jmp L55D1
L5595: lda event_params+1
L5595: lda event_params+MGTK::Event::key
and #CHAR_MASK
cmp #CHAR_RETURN
beq L55D1
@ -4405,10 +4405,10 @@ L65D0: cmp16 grafport2::cliprect::x2, L7B63
L65E2: lsr16 L6602
lda L6602
L65EB: jsr L62BC
L65EE: sta event_params+1
lda #$02
sta event_params
MGTK_RELAY_CALL MGTK::UpdateThumb, event_params
L65EE: sta updatethumb_thumbpos
lda #MGTK::ctl_horizontal_scroll_bar
sta updatethumb_which_ctl
MGTK_RELAY_CALL MGTK::UpdateThumb, updatethumb_params
rts
L6600: .word 0
@ -4446,10 +4446,10 @@ L667B: lsr16 L66A0
lsr16 L66A0
lda L66A0
L668A: jsr L62BC
L668D: sta event_params+1
lda #$01
sta event_params
MGTK_RELAY_CALL MGTK::UpdateThumb, event_params
L668D: sta updatethumb_thumbpos
lda #MGTK::ctl_vertical_scroll_bar
sta updatethumb_which_ctl
MGTK_RELAY_CALL MGTK::UpdateThumb, updatethumb_params
rts
L669F: .byte 0

View File

@ -34,11 +34,11 @@ event_ycoord := event_params + 3
event_window_id := event_params + 1
activatectl_params := *
activatectl_which_ctl := activatectl_params
activatectl_which_ctl := activatectl_params + 0
activatectl_activate := activatectl_params + 1
trackthumb_params := *
trackthumb_which_ctl := trackthumb_params
trackthumb_which_ctl := trackthumb_params + 0
trackthumb_mousex := trackthumb_params + 1
trackthumb_mousey := trackthumb_params + 3
trackthumb_thumbpos := trackthumb_params + 5

View File

@ -261,17 +261,24 @@ GetCursorAddr := $28 ; Get cursor definition
;;; --------------------------------------------------
;;; Event Manager Calls
;;; Event record:
;;;
;;; .byte kind event_kind_*
;;; if kind is event_kind_key_down:
;;; .byte key (ASCII code; high bit clear)
;;; .byte modifiers (0=none, 1=open-apple, 2=solid-apple, 3=both)
;;; if kind is event_kind_update:
;;; .byte window_id
;;; otherwise:
;;; .word xcoord
;;; .word ycoord
.struct Event
kind .byte ; event_kind_*
.union
.struct ; event_kind_down
key .byte ; ASCII code; high bit clear
modifiers .byte ; 0=none, 1=open-apple, 2=solid-apple, 3=both
.endstruct
.struct ; event_kind_update
window_id .byte
.endstruct
.struct ; otherwise
xcoord .word
ycoord .word
.endstruct
.endunion
.endstruct
CheckEvents := $29 ; Process mouse/kbd if GetEvent will be delayed.
;;; (no parameters)