summaryrefslogtreecommitdiff
path: root/atari
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
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')
-rw-r--r--atari/deskmenu.c8
-rwxr-xr-xatari/rootwin.c12
2 files changed, 14 insertions, 6 deletions
diff --git a/atari/deskmenu.c b/atari/deskmenu.c
index 676896bfd..e2b0dea6b 100644
--- a/atari/deskmenu.c
+++ b/atari/deskmenu.c
@@ -117,7 +117,7 @@ struct s_menu_item_evnt menu_evnt_tbl[] =
{T_VIEW, MAINMENU_M_STOP, menu_stop, {0,NK_ESC,K_ALT}, NULL},
{T_NAV, MAINMENU_M_BACK, menu_back, {0,NK_LEFT,K_ALT}, NULL},
{T_NAV, MAINMENU_M_FORWARD, menu_forward, {0,NK_RIGHT,K_ALT}, NULL},
- {T_NAV, MAINMENU_M_HOME, menu_home, {0,NK_CLRHOME,0}, NULL},
+ {T_NAV, MAINMENU_M_HOME, menu_home, {0,0,0}, NULL},
{T_UTIL, MAINMENU_M_LHISTORY,menu_lhistory, {0,NK_F7,0}, NULL},
{T_UTIL, MAINMENU_M_GHISTORY, menu_ghistory, {0,NK_F7,K_CTRL}, NULL},
{T_UTIL, MAINMENU_M_ADD_BOOKMARK, menu_add_bookmark, {'D',0,K_CTRL}, NULL},
@@ -169,7 +169,7 @@ static void __CDECL menu_about(short item, short title, void *data)
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
- }
+ }
}
static void __CDECL menu_new_win(short item, short title, void *data)
@@ -179,7 +179,7 @@ static void __CDECL menu_new_win(short item, short title, void *data)
const char *addr;
LOG(("%s", __FUNCTION__));
-
+
if (nsoption_charp(homepage_url) != NULL) {
addr = nsoption_charp(homepage_url);
} else {
@@ -250,7 +250,7 @@ static void __CDECL menu_open_file(short item, short title, void *data)
NULL,
NULL);
nsurl_unref(url);
-
+
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
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;
}