summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/textarea.c12
-rw-r--r--desktop/textinput.c7
-rw-r--r--desktop/textinput.h56
-rw-r--r--desktop/treeview.c2
-rw-r--r--frontends/amiga/clipboard.c2
-rw-r--r--frontends/amiga/ctxmenu.c2
-rw-r--r--frontends/amiga/gui.c2
-rw-r--r--frontends/amiga/menu.c2
-rw-r--r--frontends/amiga/tree.c2
-rw-r--r--frontends/atari/ctxmenu.c2
-rw-r--r--frontends/atari/deskmenu.c2
-rw-r--r--frontends/atari/download.c5
-rw-r--r--frontends/atari/hotlist.c2
-rw-r--r--frontends/atari/misc.c2
-rw-r--r--frontends/atari/rootwin.c11
-rw-r--r--frontends/atari/toolbar.c6
-rw-r--r--frontends/beos/cookies.cpp2
-rw-r--r--frontends/beos/scaffolding.cpp2
-rw-r--r--frontends/beos/window.cpp2
-rw-r--r--frontends/cocoa/BookmarksController.m2
-rw-r--r--frontends/cocoa/BrowserView.m2
-rw-r--r--frontends/cocoa/BrowserViewController.m1
-rw-r--r--frontends/cocoa/NetsurfApp.m1
-rw-r--r--frontends/cocoa/TreeView.m2
-rw-r--r--frontends/cocoa/gui.m1
-rw-r--r--frontends/framebuffer/fbtk/event.c2
-rw-r--r--frontends/framebuffer/gui.c2
-rw-r--r--frontends/gtk/cookies.c3
-rw-r--r--frontends/gtk/gui.c10
-rw-r--r--frontends/gtk/history.c3
-rw-r--r--frontends/gtk/hotlist.c2
-rw-r--r--frontends/gtk/scaffolding.c6
-rw-r--r--frontends/gtk/window.c2
-rw-r--r--frontends/riscos/cookies.c2
-rw-r--r--frontends/riscos/global_history.c2
-rw-r--r--frontends/riscos/hotlist.c2
-rw-r--r--frontends/riscos/menus.c1
-rw-r--r--frontends/riscos/textselection.c1
-rw-r--r--frontends/riscos/treeview.c2
-rw-r--r--frontends/riscos/window.c2
-rw-r--r--frontends/windows/drawable.c2
-rw-r--r--frontends/windows/window.c2
-rw-r--r--include/netsurf/keypress.h83
-rw-r--r--render/box_textarea.c2
-rw-r--r--render/html_interaction.c2
-rw-r--r--render/textplain.c8
46 files changed, 153 insertions, 120 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 80a2acf25..203c28e93 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -29,16 +29,16 @@
#include "utils/log.h"
#include "utils/utf8.h"
#include "utils/utils.h"
-#include "css/utils.h"
-
#include "netsurf/browser_window.h"
-#include "netsurf/mouse.h"
-#include "desktop/textarea.h"
-#include "desktop/textinput.h"
#include "netsurf/plotters.h"
-#include "desktop/scrollbar.h"
+#include "netsurf/mouse.h"
+#include "netsurf/keypress.h"
#include "netsurf/clipboard.h"
#include "netsurf/layout.h"
+#include "css/utils.h"
+
+#include "desktop/textarea.h"
+#include "desktop/scrollbar.h"
#include "desktop/gui_internal.h"
#define CARET_COLOR 0x0000FF
diff --git a/desktop/textinput.c b/desktop/textinput.c
index d4a8bf8b4..c0e0ba8f7 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -33,15 +33,16 @@
#include "utils/talloc.h"
#include "utils/utf8.h"
#include "utils/utils.h"
+#include "netsurf/mouse.h"
#include "netsurf/form.h"
+#include "netsurf/window.h"
+#include "netsurf/keypress.h"
#include "render/box.h"
#include "render/html_internal.h"
#include "render/layout.h"
-#include "netsurf/mouse.h"
#include "desktop/browser_private.h"
#include "desktop/textinput.h"
-#include "netsurf/window.h"
#include "desktop/gui_internal.h"
/* Define to enable textinput debug */
@@ -101,7 +102,7 @@ void browser_window_remove_caret(struct browser_window *bw, bool only_hide)
}
}
-/* exported interface documented in desktop/textinput.h */
+/* exported interface documented in netsurf/keypress.h */
bool browser_window_key_press(struct browser_window *bw, uint32_t key)
{
struct browser_window *focus = bw->focus;
diff --git a/desktop/textinput.h b/desktop/textinput.h
index 0b3593104..5859ea8d6 100644
--- a/desktop/textinput.h
+++ b/desktop/textinput.h
@@ -19,8 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/** \file
- * Textual input handling (interface)
+/**
+ * \file
+ * Textual input handling interface
*/
#ifndef _NETSURF_DESKTOP_TEXTINPUT_H_
@@ -28,49 +29,6 @@
struct browser_window;
-enum input_key {
-
- NS_KEY_SELECT_ALL = 1,
- NS_KEY_COPY_SELECTION = 3,
-
- NS_KEY_DELETE_LEFT = 8,
- NS_KEY_TAB = 9,
-
- NS_KEY_NL = 10,
- NS_KEY_SHIFT_TAB = 11,
- NS_KEY_CR = 13,
-
- NS_KEY_DELETE_LINE = 21,
- NS_KEY_PASTE = 22,
- NS_KEY_CUT_SELECTION = 24,
- NS_KEY_CLEAR_SELECTION = 26,
-
- NS_KEY_ESCAPE = 27,
-
- /* cursor movement keys */
- NS_KEY_LEFT = 28,
- NS_KEY_RIGHT,
- NS_KEY_UP,
- NS_KEY_DOWN,
-
- NS_KEY_DELETE_RIGHT = 127,
-
- NS_KEY_LINE_START = 128,
- NS_KEY_LINE_END,
- NS_KEY_TEXT_START,
- NS_KEY_TEXT_END,
- NS_KEY_WORD_LEFT,
- NS_KEY_WORD_RIGHT,
- NS_KEY_PAGE_UP,
- NS_KEY_PAGE_DOWN,
- NS_KEY_DELETE_LINE_END,
- NS_KEY_DELETE_LINE_START,
-
- NS_KEY_UNDO,
- NS_KEY_REDO
-};
-
-
/**
* Position the caret and assign a callback for key presses.
*
@@ -91,13 +49,5 @@ void browser_window_place_caret(struct browser_window *bw, int x, int y,
*/
void browser_window_remove_caret(struct browser_window *bw, bool only_hide);
-/**
- * Handle key presses in a browser window.
- *
- * \param bw The root browser window
- * \param key The UCS4 character codepoint
- * \return true if key handled, false otherwise
- */
-bool browser_window_key_press(struct browser_window *bw, uint32_t key);
#endif
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 8f0afcbb2..f2af5e8a1 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -29,6 +29,7 @@
#include "netsurf/plotters.h"
#include "netsurf/clipboard.h"
#include "netsurf/layout.h"
+#include "netsurf/keypress.h"
#include "content/hlcache.h"
#include "css/utils.h"
@@ -37,7 +38,6 @@
#include "desktop/textarea.h"
#include "desktop/treeview.h"
#include "desktop/gui_internal.h"
-#include "desktop/textinput.h"
#include "desktop/core_window.h"
/** @todo get rid of REDRAW_MAX -- need to be able to know window size */
diff --git a/frontends/amiga/clipboard.c b/frontends/amiga/clipboard.c
index 1b87f5b57..2dce06845 100644
--- a/frontends/amiga/clipboard.c
+++ b/frontends/amiga/clipboard.c
@@ -33,7 +33,7 @@
#include "netsurf/content.h"
#include "netsurf/browser_window.h"
#include "netsurf/plotters.h"
-#include "desktop/textinput.h"
+#include "netsurf/keypress.h"
#include "netsurf/window.h"
#include "netsurf/clipboard.h"
diff --git a/frontends/amiga/ctxmenu.c b/frontends/amiga/ctxmenu.c
index a68819298..717096f52 100644
--- a/frontends/amiga/ctxmenu.c
+++ b/frontends/amiga/ctxmenu.c
@@ -43,9 +43,9 @@
#include "netsurf/content.h"
#include "netsurf/browser_window.h"
#include "netsurf/mouse.h"
+#include "netsurf/keypress.h"
#include "desktop/browser_history.h"
#include "desktop/searchweb.h"
-#include "desktop/textinput.h"
#include "amiga/bitmap.h"
#include "amiga/clipboard.h"
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index ba7f979ef..4cfb39874 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -107,6 +107,7 @@
#include "netsurf/browser_window.h"
#include "netsurf/cookie_db.h"
#include "netsurf/url_db.h"
+#include "netsurf/keypress.h"
#include "content/backing_store.h"
#include "content/fetch.h"
#include "desktop/browser_history.h"
@@ -115,7 +116,6 @@
#include "desktop/save_complete.h"
#include "desktop/scrollbar.h"
#include "desktop/searchweb.h"
-#include "desktop/textinput.h"
#include "desktop/tree.h"
/* NetSurf Amiga platform includes */
diff --git a/frontends/amiga/menu.c b/frontends/amiga/menu.c
index 636951ea3..58ea27e1e 100644
--- a/frontends/amiga/menu.c
+++ b/frontends/amiga/menu.c
@@ -51,8 +51,8 @@
#include "netsurf/mouse.h"
#include "netsurf/window.h"
#include "netsurf/content.h"
+#include "netsurf/keypress.h"
#include "desktop/hotlist.h"
-#include "desktop/textinput.h"
#include "desktop/version.h"
#include "amiga/arexx.h"
diff --git a/frontends/amiga/tree.c b/frontends/amiga/tree.c
index c46eee460..f02fdcdbb 100644
--- a/frontends/amiga/tree.c
+++ b/frontends/amiga/tree.c
@@ -55,12 +55,12 @@
#include "utils/messages.h"
#include "netsurf/browser_window.h"
#include "netsurf/window.h"
+#include "netsurf/keypress.h"
#include "content/llcache.h"
#include "desktop/cookie_manager.h"
#include "desktop/global_history.h"
#include "desktop/hotlist.h"
#include "desktop/sslcert_viewer.h"
-#include "desktop/textinput.h"
#include "amiga/gui.h"
#include "amiga/tree.h"
diff --git a/frontends/atari/ctxmenu.c b/frontends/atari/ctxmenu.c
index f3f5f6dbb..e25d8e522 100644
--- a/frontends/atari/ctxmenu.c
+++ b/frontends/atari/ctxmenu.c
@@ -22,7 +22,7 @@
#include "utils/nsurl.h"
#include "netsurf/browser_window.h"
#include "netsurf/content.h"
-#include "desktop/textinput.h"
+#include "netsurf/keypress.h"
#include "atari/gui.h"
#include "atari/misc.h"
diff --git a/frontends/atari/deskmenu.c b/frontends/atari/deskmenu.c
index 2bb65cf4a..77df4e568 100644
--- a/frontends/atari/deskmenu.c
+++ b/frontends/atari/deskmenu.c
@@ -24,8 +24,8 @@
#include "utils/messages.h"
#include "utils/nsoption.h"
#include "netsurf/browser_window.h"
+#include "netsurf/keypress.h"
#include "desktop/save_complete.h"
-#include "desktop/textinput.h"
#include "atari/res/netsurf.rsh"
#include "atari/gemtk/gemtk.h"
diff --git a/frontends/atari/download.c b/frontends/atari/download.c
index e475a15b7..3e7a68584 100644
--- a/frontends/atari/download.c
+++ b/frontends/atari/download.c
@@ -31,11 +31,10 @@
#include "utils/utils.h"
#include "utils/nsoption.h"
#include "utils/string.h"
-#include "desktop/save_complete.h"
-#include "desktop/textinput.h"
-#include "desktop/download.h"
#include "netsurf/browser_window.h"
#include "netsurf/download.h"
+#include "desktop/save_complete.h"
+#include "desktop/download.h"
#include "atari/gui.h"
#include "atari/misc.h"
diff --git a/frontends/atari/hotlist.c b/frontends/atari/hotlist.c
index 577344f91..d55223054 100644
--- a/frontends/atari/hotlist.c
+++ b/frontends/atari/hotlist.c
@@ -28,10 +28,10 @@
#include "utils/utils.h"
#include "utils/nsoption.h"
#include "utils/nsurl.h"
+#include "netsurf/keypress.h"
#include "content/content.h"
#include "desktop/hotlist.h"
#include "desktop/tree.h"
-#include "desktop/textinput.h"
#include "atari/gui.h"
#include "atari/misc.h"
diff --git a/frontends/atari/misc.c b/frontends/atari/misc.c
index 013304bd8..81c0b9521 100644
--- a/frontends/atari/misc.c
+++ b/frontends/atari/misc.c
@@ -32,9 +32,9 @@
#include "utils/file.h"
#include "utils/dirent.h"
#include "netsurf/mouse.h"
+#include "netsurf/keypress.h"
#include "content/content.h"
#include "content/hlcache.h"
-#include "desktop/textinput.h"
#include "desktop/cookie_manager.h"
#include "desktop/tree.h"
diff --git a/frontends/atari/rootwin.c b/frontends/atari/rootwin.c
index d4920094f..dd41e175d 100644
--- a/frontends/atari/rootwin.c
+++ b/frontends/atari/rootwin.c
@@ -14,10 +14,11 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * Module Description:
- *
- * This File implements the NetSurf Browser window, or passed functionality to
+ */
+
+/**
+ * \file
+ * Implements the NetSurf Browser window, or passed functionality to
* the appropriate widget's.
*
*/
@@ -41,7 +42,7 @@
#include "netsurf/browser_window.h"
#include "netsurf/mouse.h"
#include "netsurf/plotters.h"
-#include "desktop/textinput.h"
+#include "netsurf/keypress.h"
#include "atari/res/netsurf.rsh"
#include "atari/gemtk/gemtk.h"
diff --git a/frontends/atari/toolbar.c b/frontends/atari/toolbar.c
index caf1d666d..84f0b3f98 100644
--- a/frontends/atari/toolbar.c
+++ b/frontends/atari/toolbar.c
@@ -31,15 +31,15 @@
#include "utils/nsoption.h"
#include "utils/nsurl.h"
#include "utils/utf8.h"
-#include "desktop/browser_history.h"
#include "netsurf/browser_window.h"
#include "netsurf/mouse.h"
-#include "desktop/plot_style.h"
#include "netsurf/plotters.h"
+#include "netsurf/keypress.h"
+#include "desktop/plot_style.h"
+#include "desktop/browser_history.h"
#include "desktop/tree.h"
#include "desktop/hotlist.h"
#include "desktop/textarea.h"
-#include "desktop/textinput.h"
#include "atari/clipboard.h"
#include "atari/gui.h"
diff --git a/frontends/beos/cookies.cpp b/frontends/beos/cookies.cpp
index 8e6801e43..66cf8bbef 100644
--- a/frontends/beos/cookies.cpp
+++ b/frontends/beos/cookies.cpp
@@ -25,9 +25,9 @@ extern "C" {
#include "netsurf/mouse.h"
#include "netsurf/plotters.h"
#include "netsurf/cookie_db.h"
+#include "netsurf/keypress.h"
#include "desktop/cookie_manager.h"
#include "desktop/tree.h"
-#include "desktop/textinput.h"
}
#include "beos/cookies.h"
diff --git a/frontends/beos/scaffolding.cpp b/frontends/beos/scaffolding.cpp
index 8f3baacb1..47f18c952 100644
--- a/frontends/beos/scaffolding.cpp
+++ b/frontends/beos/scaffolding.cpp
@@ -65,11 +65,11 @@ extern "C" {
#include "netsurf/content_type.h"
#include "netsurf/browser_window.h"
#include "netsurf/form.h"
+#include "netsurf/keypress.h"
#include "desktop/browser_history.h"
#include "desktop/version.h"
#include "desktop/searchweb.h"
#include "desktop/search.h"
-#include "desktop/textinput.h"
}
#include "beos/about.h"
diff --git a/frontends/beos/window.cpp b/frontends/beos/window.cpp
index 2944033fc..07d6af2fb 100644
--- a/frontends/beos/window.cpp
+++ b/frontends/beos/window.cpp
@@ -47,7 +47,7 @@ extern "C" {
#include "netsurf/window.h"
#include "netsurf/clipboard.h"
#include "netsurf/url_db.h"
-#include "desktop/textinput.h"
+#include "netsurf/keypress.h"
}
#include "beos/about.h"
diff --git a/frontends/cocoa/BookmarksController.m b/frontends/cocoa/BookmarksController.m
index f04a084fe..07b2c5034 100644
--- a/frontends/cocoa/BookmarksController.m
+++ b/frontends/cocoa/BookmarksController.m
@@ -20,9 +20,9 @@
#import "utils/utils.h"
#import "utils/nsurl.h"
#import "netsurf/browser_window.h"
+#import "netsurf/keypress.h"
#import "desktop/hotlist.h"
#import "desktop/tree.h"
-#import "desktop/textinput.h"
#import "cocoa/BookmarksController.h"
#import "cocoa/Tree.h"
diff --git a/frontends/cocoa/BrowserView.m b/frontends/cocoa/BrowserView.m
index 2d1912840..f1259d835 100644
--- a/frontends/cocoa/BrowserView.m
+++ b/frontends/cocoa/BrowserView.m
@@ -23,7 +23,7 @@
#import "netsurf/browser_window.h"
#import "netsurf/plotters.h"
#import "netsurf/content.h"
-#import "desktop/textinput.h"
+#import "netsurf/keypress.h"
#import "cocoa/gui.h"
#import "cocoa/BrowserView.h"
diff --git a/frontends/cocoa/BrowserViewController.m b/frontends/cocoa/BrowserViewController.m
index 777f4bc5d..4cac57ef3 100644
--- a/frontends/cocoa/BrowserViewController.m
+++ b/frontends/cocoa/BrowserViewController.m
@@ -25,7 +25,6 @@
#import "netsurf/content.h"
#import "netsurf/browser_window.h"
#import "desktop/browser_history.h"
-#import "desktop/textinput.h"
#import "cocoa/gui.h"
#import "cocoa/BrowserViewController.h"
diff --git a/frontends/cocoa/NetsurfApp.m b/frontends/cocoa/NetsurfApp.m
index 520659121..54a1a824a 100644
--- a/frontends/cocoa/NetsurfApp.m
+++ b/frontends/cocoa/NetsurfApp.m
@@ -40,7 +40,6 @@
#import "netsurf/cookie_db.h"
#import "netsurf/url_db.h"
#import "desktop/save_complete.h"
-#import "desktop/textinput.h"
#import "desktop/tree.h"
#ifndef NETSURF_HOMEPAGE
diff --git a/frontends/cocoa/TreeView.m b/frontends/cocoa/TreeView.m
index 71f5af450..949c3c228 100644
--- a/frontends/cocoa/TreeView.m
+++ b/frontends/cocoa/TreeView.m
@@ -20,7 +20,7 @@
#import "cocoa/Tree.h"
#import "netsurf/plotters.h"
-#import "desktop/textinput.h"
+#import "netsurf/keypress.h"
@interface TreeView () <TreeDelegate>
@end
diff --git a/frontends/cocoa/gui.m b/frontends/cocoa/gui.m
index 7e6c996ec..b1847ebf5 100644
--- a/frontends/cocoa/gui.m
+++ b/frontends/cocoa/gui.m
@@ -27,7 +27,6 @@
#import "netsurf/misc.h"
#import "netsurf/browser_window.h"
#import "netsurf/content.h"
-#import "desktop/textinput.h"
#import "cocoa/gui.h"
#import "cocoa/coordinates.h"
diff --git a/frontends/framebuffer/fbtk/event.c b/frontends/framebuffer/fbtk/event.c
index dab035530..a48e63809 100644
--- a/frontends/framebuffer/fbtk/event.c
+++ b/frontends/framebuffer/fbtk/event.c
@@ -32,7 +32,7 @@
#include "utils/utils.h"
#include "utils/log.h"
#include "netsurf/browser_window.h"
-#include "desktop/textinput.h"
+#include "netsurf/keypress.h"
#include "framebuffer/gui.h"
#include "framebuffer/fbtk.h"
diff --git a/frontends/framebuffer/gui.c b/frontends/framebuffer/gui.c
index 68798866e..4936116c2 100644
--- a/frontends/framebuffer/gui.c
+++ b/frontends/framebuffer/gui.c
@@ -35,7 +35,7 @@
#include "utils/log.h"
#include "utils/messages.h"
#include "netsurf/browser_window.h"
-#include "desktop/textinput.h"
+#include "netsurf/keypress.h"
#include "desktop/browser_history.h"
#include "netsurf/plotters.h"
#include "netsurf/window.h"
diff --git a/frontends/gtk/cookies.c b/frontends/gtk/cookies.c
index f8f989347..514c8260a 100644
--- a/frontends/gtk/cookies.c
+++ b/frontends/gtk/cookies.c
@@ -21,12 +21,13 @@
*/
#include <gtk/gtk.h>
+#include <stdint.h>
#include "utils/log.h"
+#include "netsurf/keypress.h"
#include "desktop/cookie_manager.h"
#include "desktop/plot_style.h"
#include "desktop/tree.h"
-#include "desktop/textinput.h"
#include "gtk/cookies.h"
#include "gtk/plotters.h"
diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c
index d358b43db..e0044b54b 100644
--- a/frontends/gtk/gui.c
+++ b/frontends/gtk/gui.c
@@ -38,18 +38,18 @@
#include "utils/utils.h"
#include "utils/file.h"
#include "utils/nsoption.h"
-#include "content/fetch.h"
+#include "netsurf/keypress.h"
#include "netsurf/url_db.h"
#include "netsurf/cookie_db.h"
-#include "content/backing_store.h"
#include "netsurf/browser_window.h"
+#include "netsurf/misc.h"
+#include "netsurf/netsurf.h"
+#include "content/fetch.h"
+#include "content/backing_store.h"
#include "desktop/save_complete.h"
#include "desktop/save_pdf.h"
#include "desktop/searchweb.h"
-#include "desktop/textinput.h"
#include "desktop/tree.h"
-#include "netsurf/misc.h"
-#include "netsurf/netsurf.h"
#include "gtk/compat.h"
#include "gtk/warn.h"
diff --git a/frontends/gtk/history.c b/frontends/gtk/history.c
index 9c5c0b5e4..fb805d6be 100644
--- a/frontends/gtk/history.c
+++ b/frontends/gtk/history.c
@@ -18,13 +18,14 @@
*/
#include <stdlib.h>
+#include <stdint.h>
#include <gtk/gtk.h>
#include "utils/log.h"
+#include "netsurf/keypress.h"
#include "desktop/global_history.h"
#include "desktop/plot_style.h"
#include "desktop/tree.h"
-#include "desktop/textinput.h"
#include "gtk/plotters.h"
#include "gtk/scaffolding.h"
diff --git a/frontends/gtk/hotlist.c b/frontends/gtk/hotlist.c
index 82ea3e338..fa899560c 100644
--- a/frontends/gtk/hotlist.c
+++ b/frontends/gtk/hotlist.c
@@ -21,9 +21,9 @@
#include "utils/log.h"
#include "utils/nsoption.h"
+#include "netsurf/keypress.h"
#include "desktop/hotlist.h"
#include "desktop/tree.h"
-#include "desktop/textinput.h"
#include "gtk/plotters.h"
#include "gtk/scaffolding.h"
diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c
index dc0595a37..cd3779e1e 100644
--- a/frontends/gtk/scaffolding.c
+++ b/frontends/gtk/scaffolding.c
@@ -36,10 +36,11 @@
#include "utils/file.h"
#include "utils/nsurl.h"
#include "netsurf/content.h"
-#include "desktop/browser_history.h"
+#include "netsurf/keypress.h"
#include "netsurf/browser_window.h"
-#include "desktop/hotlist.h"
#include "netsurf/plotters.h"
+#include "desktop/browser_history.h"
+#include "desktop/hotlist.h"
#include "desktop/print.h"
#include "desktop/save_complete.h"
#ifdef WITH_PDF_EXPORT
@@ -48,7 +49,6 @@
#endif
#include "desktop/save_text.h"
#include "desktop/searchweb.h"
-#include "desktop/textinput.h"
#include "desktop/search.h"
#include "gtk/compat.h"
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
index b4af64821..ce2644e8e 100644
--- a/frontends/gtk/window.c
+++ b/frontends/gtk/window.c
@@ -42,6 +42,8 @@
#include "netsurf/window.h"
#include "netsurf/plotters.h"
#include "netsurf/form.h"
+#include "netsurf/keypress.h"
+#include "desktop/textarea.h"
#include "desktop/searchweb.h"
#include "desktop/textinput.h"
diff --git a/frontends/riscos/cookies.c b/frontends/riscos/cookies.c
index d5eab9958..26374a567 100644
--- a/frontends/riscos/cookies.c
+++ b/frontends/riscos/cookies.c
@@ -33,9 +33,9 @@
#include "utils/nsoption.h"
#include "utils/messages.h"
#include "utils/log.h"
+#include "netsurf/keypress.h"
#include "desktop/cookie_manager.h"
#include "desktop/tree.h"
-#include "desktop/textinput.h"
#include "riscos/cookies.h"
#include "riscos/dialog.h"
diff --git a/frontends/riscos/global_history.c b/frontends/riscos/global_history.c
index 8e339e6b9..e893630d1 100644
--- a/frontends/riscos/global_history.c
+++ b/frontends/riscos/global_history.c
@@ -35,9 +35,9 @@
#include "utils/messages.h"
#include "utils/log.h"
#include "netsurf/window.h"
+#include "netsurf/keypress.h"
#include "desktop/global_history.h"
#include "desktop/tree.h"
-#include "desktop/textinput.h"
#include "riscos/dialog.h"
#include "riscos/global_history.h"
diff --git a/frontends/riscos/hotlist.c b/frontends/riscos/hotlist.c
index f3daad088..d47702082 100644
--- a/frontends/riscos/hotlist.c
+++ b/frontends/riscos/hotlist.c
@@ -38,9 +38,9 @@
#include "utils/nsurl.h"
#include "netsurf/url_db.h"
#include "netsurf/window.h"
+#include "netsurf/keypress.h"
#include "desktop/hotlist.h"
#include "desktop/tree.h"
-#include "desktop/textinput.h"
#include "riscos/gui.h"
#include "riscos/dialog.h"
diff --git a/frontends/riscos/menus.c b/frontends/riscos/menus.c
index 9807079d5..c123a0fce 100644
--- a/frontends/riscos/menus.c
+++ b/frontends/riscos/menus.c
@@ -38,7 +38,6 @@
#include "utils/messages.h"
#include "utils/utf8.h"
#include "desktop/cookie_manager.h"
-#include "desktop/textinput.h"
#include "riscos/dialog.h"
#include "riscos/configure.h"
diff --git a/frontends/riscos/textselection.c b/frontends/riscos/textselection.c
index e4d498de3..bce35750f 100644
--- a/frontends/riscos/textselection.c
+++ b/frontends/riscos/textselection.c
@@ -33,7 +33,6 @@
#include "utils/utils.h"
#include "netsurf/clipboard.h"
#include "netsurf/window.h"
-#include "desktop/textinput.h"
#include "netsurf/browser_window.h"
#include "riscos/gui.h"
diff --git a/frontends/riscos/treeview.c b/frontends/riscos/treeview.c
index a675283a5..17981466f 100644
--- a/frontends/riscos/treeview.c
+++ b/frontends/riscos/treeview.c
@@ -40,7 +40,7 @@
#include "utils/messages.h"
#include "utils/utils.h"
#include "netsurf/plotters.h"
-#include "desktop/textinput.h"
+#include "netsurf/keypress.h"
#include "desktop/tree.h"
#include "riscos/bitmap.h"
diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c
index fe36da527..58cd86e49 100644
--- a/frontends/riscos/window.c
+++ b/frontends/riscos/window.c
@@ -59,10 +59,10 @@
#include "netsurf/bitmap.h"
#include "netsurf/url_db.h"
#include "netsurf/form.h"
+#include "netsurf/keypress.h"
#include "desktop/browser_history.h"
#include "desktop/cookie_manager.h"
#include "desktop/scrollbar.h"
-#include "desktop/textinput.h"
#include "riscos/bitmap.h"
#include "riscos/buffer.h"
diff --git a/frontends/windows/drawable.c b/frontends/windows/drawable.c
index 74aca1562..ee1c695f1 100644
--- a/frontends/windows/drawable.c
+++ b/frontends/windows/drawable.c
@@ -29,7 +29,7 @@
#include "utils/utils.h"
#include "netsurf/browser_window.h"
#include "netsurf/plotters.h"
-#include "desktop/textinput.h"
+#include "netsurf/keypress.h"
#include "windows/windbg.h"
#include "windows/plot.h"
diff --git a/frontends/windows/window.c b/frontends/windows/window.c
index bbe0e96f0..5db464a18 100644
--- a/frontends/windows/window.c
+++ b/frontends/windows/window.c
@@ -32,8 +32,8 @@
#include "content/content.h"
#include "netsurf/browser_window.h"
#include "netsurf/window.h"
+#include "netsurf/keypress.h"
#include "desktop/browser_history.h"
-#include "desktop/textinput.h"
#include "windows/gui.h"
#include "windows/pointers.h"
diff --git a/include/netsurf/keypress.h b/include/netsurf/keypress.h
new file mode 100644
index 000000000..604d2dd9b
--- /dev/null
+++ b/include/netsurf/keypress.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2016 Vincent Sanders <vince@netsurf-browser.org>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * \file
+ *
+ * Interface to key press operations.
+ */
+
+#ifndef _NETSURF_KEYPRESS_H_
+#define _NETSURF_KEYPRESS_H_
+
+struct browser_window;
+
+enum input_key {
+
+ NS_KEY_SELECT_ALL = 1,
+ NS_KEY_COPY_SELECTION = 3,
+
+ NS_KEY_DELETE_LEFT = 8,
+ NS_KEY_TAB = 9,
+
+ NS_KEY_NL = 10,
+ NS_KEY_SHIFT_TAB = 11,
+ NS_KEY_CR = 13,
+
+ NS_KEY_DELETE_LINE = 21,
+ NS_KEY_PASTE = 22,
+ NS_KEY_CUT_SELECTION = 24,
+ NS_KEY_CLEAR_SELECTION = 26,
+
+ NS_KEY_ESCAPE = 27,
+
+ /* cursor movement keys */
+ NS_KEY_LEFT = 28,
+ NS_KEY_RIGHT,
+ NS_KEY_UP,
+ NS_KEY_DOWN,
+
+ NS_KEY_DELETE_RIGHT = 127,
+
+ NS_KEY_LINE_START = 128,
+ NS_KEY_LINE_END,
+ NS_KEY_TEXT_START,
+ NS_KEY_TEXT_END,
+ NS_KEY_WORD_LEFT,
+ NS_KEY_WORD_RIGHT,
+ NS_KEY_PAGE_UP,
+ NS_KEY_PAGE_DOWN,
+ NS_KEY_DELETE_LINE_END,
+ NS_KEY_DELETE_LINE_START,
+
+ NS_KEY_UNDO,
+ NS_KEY_REDO
+};
+
+
+/**
+ * Handle key presses in a browser window.
+ *
+ * \param bw The root browser window
+ * \param key The UCS4 character codepoint
+ * \return true if key handled, false otherwise
+ */
+bool browser_window_key_press(struct browser_window *bw, uint32_t key);
+
+
+#endif
diff --git a/render/box_textarea.c b/render/box_textarea.c
index 79ace8dea..44f5c0b16 100644
--- a/render/box_textarea.c
+++ b/render/box_textarea.c
@@ -24,8 +24,8 @@
#include "utils/config.h"
#include "utils/log.h"
+#include "netsurf/keypress.h"
#include "desktop/textarea.h"
-#include "desktop/textinput.h"
#include "render/box_textarea.h"
#include "render/font.h"
diff --git a/render/html_interaction.c b/render/html_interaction.c
index f0b50f8d3..e727a9ffc 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -39,12 +39,12 @@
#include "netsurf/mouse.h"
#include "netsurf/misc.h"
#include "netsurf/layout.h"
+#include "netsurf/keypress.h"
#include "content/hlcache.h"
#include "desktop/frames.h"
#include "desktop/scrollbar.h"
#include "desktop/selection.h"
#include "desktop/textarea.h"
-#include "desktop/textinput.h"
#include "javascript/js.h"
#include "desktop/gui_internal.h"
diff --git a/render/textplain.c b/render/textplain.c
index b008ab8da..ae148697e 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -38,16 +38,16 @@
#include "utils/utils.h"
#include "utils/utf8.h"
#include "netsurf/content.h"
+#include "netsurf/keypress.h"
+#include "netsurf/browser_window.h"
+#include "netsurf/plotters.h"
+#include "netsurf/layout.h"
#include "content/content_protected.h"
#include "content/hlcache.h"
#include "css/utils.h"
-#include "netsurf/browser_window.h"
#include "utils/nsoption.h"
-#include "netsurf/plotters.h"
#include "desktop/search.h"
#include "desktop/selection.h"
-#include "desktop/textinput.h"
-#include "netsurf/layout.h"
#include "desktop/gui_internal.h"
#include "render/search.h"