From eb1f39fe7d80893b1f7c804eb48ec61e89f17d78 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 1 Jan 2017 16:45:27 +0000 Subject: Process mouse moves and qualifier keys NB: we are doing mouse moves differently by using an IDCMP hook on space.gadget, as this gives us co-ordinates relative to the render area GID_DRAW object when the window is defined will need tagging ICA_TARGET, ICTARGET_IDCMP --- frontends/amiga/gui.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'frontends/amiga/gui.c') diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index ba0a786e3..46961dd0f 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -1376,27 +1376,34 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie) return nskey; } -static void ami_update_quals(struct gui_window_2 *gwin) +int ami_gui_get_quals(Object *win_obj) { uint32 quals = 0; + int key_state = 0; #ifdef __amigaos4__ - GetAttr(WINDOW_Qualifier,gwin->objects[OID_MAIN],(uint32 *)&quals); + GetAttr(WINDOW_Qualifier, win_obj, (uint32 *)&quals); #else #warning qualifier needs fixing for OS3 #endif - gwin->key_state = 0; if(quals & NSA_QUAL_SHIFT) { - gwin->key_state |= BROWSER_MOUSE_MOD_1; + key_state |= BROWSER_MOUSE_MOD_1; } if(quals & IEQUALIFIER_CONTROL) { - gwin->key_state |= BROWSER_MOUSE_MOD_2; + key_state |= BROWSER_MOUSE_MOD_2; } if(quals & NSA_QUAL_ALT) { - gwin->key_state |= BROWSER_MOUSE_MOD_3; + key_state |= BROWSER_MOUSE_MOD_3; } + + return key_state; +} + +static void ami_update_quals(struct gui_window_2 *gwin) +{ + gwin->key_state = ami_gui_get_quals(gwin->objects[OID_MAIN]); } /* exported interface documented in amiga/gui.h */ -- cgit v1.2.3