Skip to content

Commit

Permalink
ctk-curses: Guard ncurses-specific mouse function calls
Browse files Browse the repository at this point in the history
The mouse support is ncurses-specific so guard it with proper #ifdef.
  • Loading branch information
mmuman committed Mar 26, 2013
1 parent 86cb176 commit 2bb9ced
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions platform/native/ctk/ctk-curses.c
Expand Up @@ -76,7 +76,9 @@ ctrlhandler(int sig)
void
console_init(void)
{
#ifdef NCURSES_MOUSE_VERSION
mmask_t oldmask;
#endif
static unsigned char done;

if(done) {
Expand Down Expand Up @@ -104,8 +106,10 @@ console_init(void)
intrflush(stdscr, FALSE);
keypad(stdscr, TRUE);

#ifdef NCURSES_MOUSE_VERSION
/* done here because ctk_mouse_init() is called before anyway */
mousemask(ALL_MOUSE_EVENTS, &oldmask);
#endif

screensize(&width, &height);

Expand Down Expand Up @@ -347,6 +351,7 @@ console_readkey(int k)
key = (ctk_arch_key_t) k;
/*fprintf(stderr, "key: %d\n", k); */
switch (k) {
#ifdef NCURSES_MOUSE_VERSION
case KEY_MOUSE:
{
MEVENT event;
Expand All @@ -362,6 +367,7 @@ console_readkey(int k)
}
return;
}
#endif
case KEY_LEFT:
key = CH_CURS_LEFT;
break;
Expand Down

0 comments on commit 2bb9ced

Please sign in to comment.