diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2017-01-01 16:45:27 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2017-01-01 16:45:27 +0000 |
commit | eb1f39fe7d80893b1f7c804eb48ec61e89f17d78 (patch) | |
tree | 1badecab09f258951ce442d8ed65e1fd55803e7c /frontends/amiga/gui.c | |
parent | 31c08f39be64f739cac727ab5a13fc513d1a61aa (diff) | |
download | netsurf-eb1f39fe7d80893b1f7c804eb48ec61e89f17d78.tar.gz netsurf-eb1f39fe7d80893b1f7c804eb48ec61e89f17d78.tar.bz2 |
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
Diffstat (limited to 'frontends/amiga/gui.c')
-rw-r--r-- | frontends/amiga/gui.c | 19 |
1 files changed, 13 insertions, 6 deletions
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 */ |