summaryrefslogtreecommitdiff
path: root/atari/rootwin.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2013-04-13 15:34:08 +0200
committerOle Loots <ole@monochrom.net>2013-04-13 15:34:08 +0200
commit4e6bea9204f66c505aafc7a9951ac74ea3978920 (patch)
treec914b636efb507304d3bcc52a45783bdb608570c /atari/rootwin.c
parent437304b0377a29cc6bcc0ac1684130298d8cffb8 (diff)
downloadnetsurf-4e6bea9204f66c505aafc7a9951ac74ea3978920.tar.gz
netsurf-4e6bea9204f66c505aafc7a9951ac74ea3978920.tar.bz2
Improved CLRHOME Key handling
When textinput is focused, the key is handled by the browser (Moving to start of text). Otherwise the Content is scrolled to the top.
Diffstat (limited to 'atari/rootwin.c')
-rwxr-xr-xatari/rootwin.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/atari/rootwin.c b/atari/rootwin.c
index 6710a6bf5..a91d99099 100755
--- a/atari/rootwin.c
+++ b/atari/rootwin.c
@@ -173,11 +173,14 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
// handle key
uint16_t nkc = gem_to_norm( (short)ev_out->emo_kmeta,
(short)ev_out->emo_kreturn);
+ LOG(("rootwin MU_KEYBD input, nkc: %x\n", nkc));
retval = on_window_key_input(data->rootwin, nkc);
// printf("on_window_key_input: %d\n", retval);
}
if ((ev_out->emo_events & MU_BUTTON) != 0) {
+ LOG(("rootwin MU_BUTTON input, x: %d, y: %d\n", ev_out->emo_mouse.p_x,
+ ev_out->emo_mouse.p_x));
window_get_grect(data->rootwin, BROWSER_AREA_CONTENT,
&area);
if (POINT_WITHIN(ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y,
@@ -470,10 +473,10 @@ void window_scroll_by(ROOTWIN *root, int sx, int sy)
GRECT content_area;
struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(root->win);
- if(sx < 0) {
+ if (sx < 0) {
sx = 0;
}
- if(sy<0) {
+ if (sy < 0) {
sy = 0;
}
int xunits = sx / slid->x_unit_px;
@@ -1343,6 +1346,11 @@ static bool on_content_keypress(struct browser_window *bw, unsigned short nkc)
r = true;
break;
+ case KEY_TEXT_START:
+ window_scroll_by(bw->window->root, 0, 0);
+ r = true;
+ break;
+
default:
break;
}