added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / classes / gadgets / texteditor / mcp / Keybindings.c
blob258ad1c08826e5cba65f89884c8ee9ded0ac60fa
1 /***************************************************************************
3 TextEditor.mcc - Textediting MUI Custom Class
4 Copyright (C) 1997-2000 Allan Odgaard
5 Copyright (C) 2005 by TextEditor.mcc Open Source Team
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc
19 $Id$
21 ***************************************************************************/
23 #include <devices/inputevent.h>
25 #include "private.h"
27 // our keybindings (every rawkey value with +500 is a vanilla key specification)
29 static struct te_key k01 = { RAWKEY_CRSRUP, 0, mUp };
30 static struct te_key k02 = { RAWKEY_CRSRUP, IEQUALIFIER_ALT | IEQUALIFIER_CONTROL, mPreviousLine };
31 static struct te_key k03 = { RAWKEY_CRSRUP, IEQUALIFIER_ALT, mPreviousPage };
32 static struct te_key k04 = { RAWKEY_CRSRUP, IEQUALIFIER_CONTROL, mTop };
33 static struct te_key k05 = { RAWKEY_CRSRDOWN, 0, mDown };
34 static struct te_key k06 = { RAWKEY_CRSRDOWN, IEQUALIFIER_ALT | IEQUALIFIER_CONTROL, mNextLine };
35 static struct te_key k07 = { RAWKEY_CRSRDOWN, IEQUALIFIER_ALT, mNextPage };
36 static struct te_key k08 = { RAWKEY_CRSRDOWN, IEQUALIFIER_CONTROL, mBottom };
37 static struct te_key k09 = { RAWKEY_CRSRRIGHT, 0, mRight };
38 static struct te_key k10 = { RAWKEY_CRSRRIGHT, IEQUALIFIER_ALT, mNextWord };
39 static struct te_key k11 = { RAWKEY_CRSRRIGHT, IEQUALIFIER_CONTROL, mEndOfLine };
40 static struct te_key k12 = { RAWKEY_CRSRRIGHT, IEQUALIFIER_ALT | IEQUALIFIER_CONTROL, mNextSentence };
41 static struct te_key k13 = { RAWKEY_CRSRLEFT, 0, mLeft };
42 static struct te_key k14 = { RAWKEY_CRSRLEFT, IEQUALIFIER_ALT, mPreviousWord };
43 static struct te_key k15 = { RAWKEY_CRSRLEFT, IEQUALIFIER_CONTROL, mStartOfLine };
44 static struct te_key k16 = { RAWKEY_CRSRLEFT, IEQUALIFIER_ALT | IEQUALIFIER_CONTROL, mPreviousSentence };
46 static struct te_key k17 = { 8+500, 0, kBackspace };
47 static struct te_key k18 = { 0x7f+500, 0, kDelete };
48 static struct te_key k19 = { 13+500, 0, kReturn };
49 static struct te_key k20 = { 13+500, IEQUALIFIER_NUMERICPAD, kReturn };
50 static struct te_key k21 = { 9+500, 0, kTab };
51 static struct te_key k22 = { 'x'+500, IEQUALIFIER_RCOMMAND, kCut };
52 static struct te_key k23 = { 'c'+500, IEQUALIFIER_RCOMMAND, kCopy };
53 static struct te_key k24 = { 'v'+500, IEQUALIFIER_RCOMMAND, kPaste };
54 static struct te_key k25 = { 'z'+500, IEQUALIFIER_RCOMMAND, kUndo };
55 static struct te_key k26 = { 'z'+500, IEQUALIFIER_RCOMMAND | IEQUALIFIER_RSHIFT, kRedo };
56 static struct te_key k27 = { RAWKEY_HELP, IEQUALIFIER_COMMAND, kSuggestWord };
58 static struct te_key k28 = { 8+500, IEQUALIFIER_CONTROL, kDelBOL };
59 static struct te_key k29 = { 8+500, IEQUALIFIER_SHIFT, kDelBOL };
60 static struct te_key k30 = { 0x7f+500, IEQUALIFIER_CONTROL, kDelEOL };
61 static struct te_key k31 = { 0x7f+500, IEQUALIFIER_SHIFT, kDelEOL };
62 static struct te_key k32 = { 8+500, IEQUALIFIER_ALT, kDelBOW };
63 static struct te_key k33 = { 0x7f+500, IEQUALIFIER_ALT, kDelEOW };
64 static struct te_key k34 = { 'x'+500, IEQUALIFIER_CONTROL, kDelLine };
65 static struct te_key k35 = { 0x9+500, IEQUALIFIER_ALT, kNextGadget };
67 static struct te_key k36 = { '1'+500, IEQUALIFIER_RCOMMAND | IEQUALIFIER_RSHIFT, kSetBookmark1 };
68 static struct te_key k37 = { '2'+500, IEQUALIFIER_RCOMMAND | IEQUALIFIER_RSHIFT, kSetBookmark2 };
69 static struct te_key k38 = { '3'+500, IEQUALIFIER_RCOMMAND | IEQUALIFIER_RSHIFT, kSetBookmark3 };
71 static struct te_key k39 = { '1'+500, IEQUALIFIER_RCOMMAND, kGotoBookmark1 };
72 static struct te_key k40 = { '2'+500, IEQUALIFIER_RCOMMAND, kGotoBookmark2 };
73 static struct te_key k41 = { '3'+500, IEQUALIFIER_RCOMMAND, kGotoBookmark3 };
75 static struct te_key k42 = { RAWKEY_PAGEUP, 0, mPreviousPage };
76 static struct te_key k43 = { RAWKEY_PAGEDOWN, 0, mNextPage };
77 static struct te_key k44 = { RAWKEY_HOME, 0, mTop };
78 static struct te_key k45 = { RAWKEY_END, 0, mBottom };
80 const struct te_key *keybindings[] =
82 &k01, &k02, &k03, &k04, &k05, &k06, &k07, &k08, &k09, &k10,
83 &k11, &k12, &k13, &k14, &k15, &k16, &k17, &k18, &k19, &k20,
84 &k21, &k22, &k23, &k24, &k25, &k26, &k27, &k28, &k29, &k30,
85 &k31, &k32, &k33, &k34, &k35, &k36, &k37, &k38, &k39, &k40,
86 &k41, &k42, &k43, &k44, &k45,
87 NULL