mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-08-14 09:28:59 +00:00
ctk-curses: Guard ncurses-specific mouse function calls
The mouse support is ncurses-specific so guard it with proper #ifdef.
This commit is contained in:
parent
86cb1769f6
commit
2bb9ced3d6
@ -76,7 +76,9 @@ ctrlhandler(int sig)
|
|||||||
void
|
void
|
||||||
console_init(void)
|
console_init(void)
|
||||||
{
|
{
|
||||||
|
#ifdef NCURSES_MOUSE_VERSION
|
||||||
mmask_t oldmask;
|
mmask_t oldmask;
|
||||||
|
#endif
|
||||||
static unsigned char done;
|
static unsigned char done;
|
||||||
|
|
||||||
if(done) {
|
if(done) {
|
||||||
@ -104,8 +106,10 @@ console_init(void)
|
|||||||
intrflush(stdscr, FALSE);
|
intrflush(stdscr, FALSE);
|
||||||
keypad(stdscr, TRUE);
|
keypad(stdscr, TRUE);
|
||||||
|
|
||||||
|
#ifdef NCURSES_MOUSE_VERSION
|
||||||
/* done here because ctk_mouse_init() is called before anyway */
|
/* done here because ctk_mouse_init() is called before anyway */
|
||||||
mousemask(ALL_MOUSE_EVENTS, &oldmask);
|
mousemask(ALL_MOUSE_EVENTS, &oldmask);
|
||||||
|
#endif
|
||||||
|
|
||||||
screensize(&width, &height);
|
screensize(&width, &height);
|
||||||
|
|
||||||
@ -347,6 +351,7 @@ console_readkey(int k)
|
|||||||
key = (ctk_arch_key_t) k;
|
key = (ctk_arch_key_t) k;
|
||||||
/*fprintf(stderr, "key: %d\n", k); */
|
/*fprintf(stderr, "key: %d\n", k); */
|
||||||
switch (k) {
|
switch (k) {
|
||||||
|
#ifdef NCURSES_MOUSE_VERSION
|
||||||
case KEY_MOUSE:
|
case KEY_MOUSE:
|
||||||
{
|
{
|
||||||
MEVENT event;
|
MEVENT event;
|
||||||
@ -362,6 +367,7 @@ console_readkey(int k)
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
key = CH_CURS_LEFT;
|
key = CH_CURS_LEFT;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user