~ubuntu-branches/ubuntu/trusty/grub2/trusty-updates

« back to all changes in this revision

Viewing changes to include/grub/term.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-02-08 11:39:26 UTC
  • mfrom: (17.6.26 experimental)
  • mto: (17.6.27 experimental)
  • mto: This revision was merged to the branch mainline in revision 104.
  • Revision ID: james.westby@ubuntu.com-20110208113926-clfs90haboyk9zip
Tags: 1.99~rc1-2
* Merge 1.98+20100804-13 and 1.98+20100804-14, updating translations:
  - Kazakh (Baurzhan Muftakhidinov / Timur Birsh).
* mkconfig_skip_dmcrypt.patch: Refer to GRUB_PRELOAD_MODULES rather than
  suggesting people write a /etc/grub.d/01_modules script (thanks, Jordan
  Uggla).
* Handle empty dir passed to grub_find_root_device_from_mountinfo; fixes
  grub-mkrelpath on btrfs subvolumes (LP: #712029).
* Add rootflags=subvol=<name> if / is on a btrfs subvolume (LP: #712029).
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef GRUB_TERM_HEADER
20
20
#define GRUB_TERM_HEADER        1
21
21
 
 
22
#define GRUB_TERM_NO_KEY        0
 
23
 
22
24
/* Internal codes used by GRUB to represent terminal input.  */
23
 
#define GRUB_TERM_LEFT          2
24
 
#define GRUB_TERM_RIGHT         6
25
 
#define GRUB_TERM_UP            16
26
 
#define GRUB_TERM_DOWN          14
27
 
#define GRUB_TERM_HOME          1
28
 
#define GRUB_TERM_END           5
29
 
#define GRUB_TERM_DC            4
30
 
#define GRUB_TERM_PPAGE         7
31
 
#define GRUB_TERM_NPAGE         3
 
25
/* Only for keys otherwise not having shifted modification.  */
 
26
#define GRUB_TERM_SHIFT         0x01000000
 
27
#define GRUB_TERM_CTRL          0x02000000
 
28
#define GRUB_TERM_ALT           0x04000000
 
29
 
 
30
/* Keys without associated character.  */
 
31
#define GRUB_TERM_EXTENDED      0x00800000
 
32
#define GRUB_TERM_KEY_MASK      0x00ffffff
 
33
 
 
34
#define GRUB_TERM_KEY_LEFT      (GRUB_TERM_EXTENDED | 0x4b)
 
35
#define GRUB_TERM_KEY_RIGHT     (GRUB_TERM_EXTENDED | 0x4d)
 
36
#define GRUB_TERM_KEY_UP        (GRUB_TERM_EXTENDED | 0x48)
 
37
#define GRUB_TERM_KEY_DOWN      (GRUB_TERM_EXTENDED | 0x50)
 
38
#define GRUB_TERM_KEY_HOME      (GRUB_TERM_EXTENDED | 0x47)
 
39
#define GRUB_TERM_KEY_END       (GRUB_TERM_EXTENDED | 0x4f)
 
40
#define GRUB_TERM_KEY_DC        (GRUB_TERM_EXTENDED | 0x53)
 
41
#define GRUB_TERM_KEY_PPAGE     (GRUB_TERM_EXTENDED | 0x49)
 
42
#define GRUB_TERM_KEY_NPAGE     (GRUB_TERM_EXTENDED | 0x51)
 
43
#define GRUB_TERM_KEY_F1        (GRUB_TERM_EXTENDED | 0x3b)
 
44
#define GRUB_TERM_KEY_F2        (GRUB_TERM_EXTENDED | 0x3c)
 
45
#define GRUB_TERM_KEY_F3        (GRUB_TERM_EXTENDED | 0x3d)
 
46
#define GRUB_TERM_KEY_F4        (GRUB_TERM_EXTENDED | 0x3e)
 
47
#define GRUB_TERM_KEY_F5        (GRUB_TERM_EXTENDED | 0x3f)
 
48
#define GRUB_TERM_KEY_F6        (GRUB_TERM_EXTENDED | 0x40)
 
49
#define GRUB_TERM_KEY_F7        (GRUB_TERM_EXTENDED | 0x41)
 
50
#define GRUB_TERM_KEY_F8        (GRUB_TERM_EXTENDED | 0x42)
 
51
#define GRUB_TERM_KEY_F9        (GRUB_TERM_EXTENDED | 0x43)
 
52
#define GRUB_TERM_KEY_F10       (GRUB_TERM_EXTENDED | 0x44)
 
53
#define GRUB_TERM_KEY_F11       (GRUB_TERM_EXTENDED | 0x57)
 
54
#define GRUB_TERM_KEY_F12       (GRUB_TERM_EXTENDED | 0x58)
 
55
#define GRUB_TERM_KEY_INSERT    (GRUB_TERM_EXTENDED | 0x52)
 
56
#define GRUB_TERM_KEY_CENTER    (GRUB_TERM_EXTENDED | 0x4c)
 
57
 
32
58
#define GRUB_TERM_ESC           '\e'
33
59
#define GRUB_TERM_TAB           '\t'
34
 
#define GRUB_TERM_BACKSPACE     8
 
60
#define GRUB_TERM_BACKSPACE     '\b'
35
61
 
36
62
#ifndef ASM_FILE
37
63
 
86
112
 
87
113
 
88
114
/* Bitmasks for modifier keys returned by grub_getkeystatus.  */
89
 
#define GRUB_TERM_STATUS_SHIFT  (1 << 0)
90
 
#define GRUB_TERM_STATUS_CTRL   (1 << 1)
91
 
#define GRUB_TERM_STATUS_ALT    (1 << 2)
 
115
#define GRUB_TERM_STATUS_RSHIFT (1 << 0)
 
116
#define GRUB_TERM_STATUS_LSHIFT (1 << 1)
 
117
#define GRUB_TERM_STATUS_RCTRL  (1 << 2)
 
118
#define GRUB_TERM_STATUS_RALT   (1 << 3)
 
119
#define GRUB_TERM_STATUS_SCROLL (1 << 4)
 
120
#define GRUB_TERM_STATUS_NUM    (1 << 5)
 
121
#define GRUB_TERM_STATUS_CAPS   (1 << 6)
 
122
#define GRUB_TERM_STATUS_LCTRL  (1 << 8)
 
123
#define GRUB_TERM_STATUS_LALT   (1 << 9)
92
124
 
93
125
/* Menu-related geometrical constants.  */
94
126
 
128
160
  /* Clean up the terminal.  */
129
161
  grub_err_t (*fini) (struct grub_term_input *term);
130
162
 
131
 
  /* Check if any input character is available.  */
132
 
  int (*checkkey) (struct grub_term_input *term);
133
 
 
134
 
  /* Get a character.  */
 
163
  /* Get a character if any input character is available. Otherwise return -1  */
135
164
  int (*getkey) (struct grub_term_input *term);
136
165
 
137
166
  /* Get keyboard modifier status.  */
279
308
void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
280
309
int EXPORT_FUNC(grub_getkey) (void);
281
310
int EXPORT_FUNC(grub_checkkey) (void);
282
 
int EXPORT_FUNC(grub_getkeystatus) (void);
283
311
void grub_cls (void);
284
312
void EXPORT_FUNC(grub_refresh) (void);
285
313
void grub_puts_terminal (const char *str, struct grub_term_output *term);
459
487
    grub_putcode (' ', term);
460
488
}
461
489
 
 
490
extern void (*EXPORT_VAR (grub_term_poll_usb)) (void);
462
491
 
463
 
/* For convenience.  */
464
 
#define GRUB_TERM_ASCII_CHAR(c) ((c) & 0xff)
 
492
#define GRUB_TERM_REPEAT_PRE_INTERVAL 400
 
493
#define GRUB_TERM_REPEAT_INTERVAL 50
465
494
 
466
495
#endif /* ! ASM_FILE */
467
496