NetSurf
include
netsurf
keypress.h
Go to the documentation of this file.
1
/*
2
* Copyright 2016 Vincent Sanders <vince@netsurf-browser.org>
3
*
4
* This file is part of NetSurf, http://www.netsurf-browser.org/
5
*
6
* NetSurf is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
9
*
10
* NetSurf is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
/**
20
* \file
21
*
22
* Interface to key press operations.
23
*/
24
25
#ifndef _NETSURF_KEYPRESS_H_
26
#define _NETSURF_KEYPRESS_H_
27
28
struct
browser_window
;
29
30
enum
input_key
{
31
32
NS_KEY_SELECT_ALL
= 1,
33
NS_KEY_COPY_SELECTION
= 3,
34
35
NS_KEY_DELETE_LEFT
= 8,
36
NS_KEY_TAB
= 9,
37
38
NS_KEY_NL
= 10,
39
NS_KEY_SHIFT_TAB
= 11,
40
NS_KEY_CR
= 13,
41
42
NS_KEY_DELETE_LINE
= 21,
43
NS_KEY_PASTE
= 22,
44
NS_KEY_CUT_SELECTION
= 24,
45
NS_KEY_CLEAR_SELECTION
= 26,
46
47
NS_KEY_ESCAPE
= 27,
48
49
/* cursor movement keys */
50
NS_KEY_LEFT
= 28,
51
NS_KEY_RIGHT
,
52
NS_KEY_UP
,
53
NS_KEY_DOWN
,
54
55
NS_KEY_DELETE_RIGHT
= 127,
56
57
NS_KEY_LINE_START
= 128,
58
NS_KEY_LINE_END
,
59
NS_KEY_TEXT_START
,
60
NS_KEY_TEXT_END
,
61
NS_KEY_WORD_LEFT
,
62
NS_KEY_DELETE_WORD_LEFT
,
63
NS_KEY_WORD_RIGHT
,
64
NS_KEY_DELETE_WORD_RIGHT
,
65
NS_KEY_PAGE_UP
,
66
NS_KEY_PAGE_DOWN
,
67
NS_KEY_DELETE_LINE_END
,
68
NS_KEY_DELETE_LINE_START
,
69
70
NS_KEY_UNDO
,
71
NS_KEY_REDO
72
};
73
74
75
/**
76
* Handle key presses in a browser window.
77
*
78
* \param bw The root browser window
79
* \param key The UCS4 character codepoint
80
* \return true if key handled, false otherwise
81
*/
82
bool
browser_window_key_press
(
struct
browser_window
*
bw
, uint32_t key);
83
84
85
#endif
input_key
input_key
Definition:
keypress.h:30
NS_KEY_DELETE_WORD_RIGHT
@ NS_KEY_DELETE_WORD_RIGHT
Definition:
keypress.h:64
NS_KEY_REDO
@ NS_KEY_REDO
Definition:
keypress.h:71
NS_KEY_DELETE_LINE_START
@ NS_KEY_DELETE_LINE_START
Definition:
keypress.h:68
NS_KEY_SHIFT_TAB
@ NS_KEY_SHIFT_TAB
Definition:
keypress.h:39
NS_KEY_LINE_START
@ NS_KEY_LINE_START
Definition:
keypress.h:57
NS_KEY_CR
@ NS_KEY_CR
Definition:
keypress.h:40
NS_KEY_RIGHT
@ NS_KEY_RIGHT
Definition:
keypress.h:51
NS_KEY_DELETE_WORD_LEFT
@ NS_KEY_DELETE_WORD_LEFT
Definition:
keypress.h:62
NS_KEY_LEFT
@ NS_KEY_LEFT
Definition:
keypress.h:50
NS_KEY_SELECT_ALL
@ NS_KEY_SELECT_ALL
Definition:
keypress.h:32
NS_KEY_PASTE
@ NS_KEY_PASTE
Definition:
keypress.h:43
NS_KEY_TAB
@ NS_KEY_TAB
Definition:
keypress.h:36
NS_KEY_COPY_SELECTION
@ NS_KEY_COPY_SELECTION
Definition:
keypress.h:33
NS_KEY_DOWN
@ NS_KEY_DOWN
Definition:
keypress.h:53
NS_KEY_CUT_SELECTION
@ NS_KEY_CUT_SELECTION
Definition:
keypress.h:44
NS_KEY_WORD_LEFT
@ NS_KEY_WORD_LEFT
Definition:
keypress.h:61
NS_KEY_DELETE_LINE_END
@ NS_KEY_DELETE_LINE_END
Definition:
keypress.h:67
NS_KEY_PAGE_UP
@ NS_KEY_PAGE_UP
Definition:
keypress.h:65
NS_KEY_PAGE_DOWN
@ NS_KEY_PAGE_DOWN
Definition:
keypress.h:66
NS_KEY_UNDO
@ NS_KEY_UNDO
Definition:
keypress.h:70
NS_KEY_TEXT_START
@ NS_KEY_TEXT_START
Definition:
keypress.h:59
NS_KEY_LINE_END
@ NS_KEY_LINE_END
Definition:
keypress.h:58
NS_KEY_TEXT_END
@ NS_KEY_TEXT_END
Definition:
keypress.h:60
NS_KEY_DELETE_RIGHT
@ NS_KEY_DELETE_RIGHT
Definition:
keypress.h:55
NS_KEY_NL
@ NS_KEY_NL
Definition:
keypress.h:38
NS_KEY_CLEAR_SELECTION
@ NS_KEY_CLEAR_SELECTION
Definition:
keypress.h:45
NS_KEY_WORD_RIGHT
@ NS_KEY_WORD_RIGHT
Definition:
keypress.h:63
NS_KEY_DELETE_LINE
@ NS_KEY_DELETE_LINE
Definition:
keypress.h:42
NS_KEY_DELETE_LEFT
@ NS_KEY_DELETE_LEFT
Definition:
keypress.h:35
NS_KEY_UP
@ NS_KEY_UP
Definition:
keypress.h:52
NS_KEY_ESCAPE
@ NS_KEY_ESCAPE
Definition:
keypress.h:47
browser_window_key_press
bool browser_window_key_press(struct browser_window *bw, uint32_t key)
Handle key presses in a browser window.
Definition:
textinput.c:107
browser_window
Browser window data.
Definition:
browser_private.h:96
browser_window::bw
struct browser_window * bw
Definition:
browser_private.h:260
Generated on Fri Dec 27 2024 08:42:10 for NetSurf by
1.9.4