X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=sidebyside;f=ncurses%2Fbase%2Flib_mouse.c;h=ed58148ba455d1825818a467ec4322ff0622a37f;hb=3247e20e3f6d0ba0921604100383d572fbbf507a;hp=61ec3c8b71160baedc7ff32089da66f12ae686c9;hpb=af3d0ee323cbb22d2a7596d564bf68f7307f5076;p=ncurses.git diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index 61ec3c8b..ed58148b 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * + * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -84,7 +84,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mouse.c,v 1.175 2017/06/17 22:05:15 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.178 2018/09/23 08:40:23 tom Exp $") #include @@ -486,15 +486,17 @@ load_gpm_library(SCREEN *sp) { sp->_mouse_gpm_found = FALSE; if ((sp->_dlopen_gpm = dlopen(LIBGPM_SONAME, my_RTLD)) != 0) { -#pragma GCC diagnostic push #if (defined(__GNUC__) && (__GNUC__ >= 5)) || defined(__clang__) +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" #endif if (GET_DLSYM(gpm_fd) == 0 || GET_DLSYM(Gpm_Open) == 0 || GET_DLSYM(Gpm_Close) == 0 || GET_DLSYM(Gpm_GetEvent) == 0) { +#if (defined(__GNUC__) && (__GNUC__ >= 5)) || defined(__clang__) #pragma GCC diagnostic pop +#endif T(("GPM initialization failed: %s", dlerror())); unload_gpm_library(sp); } else { @@ -1274,6 +1276,15 @@ decode_xterm_SGR1006(SCREEN *sp, MEVENT * eventp) } else { eventp->bstate = REPORT_MOUSE_POSITION; } + if (b & 4) { + eventp->bstate |= BUTTON_SHIFT; + } + if (b & 8) { + eventp->bstate |= BUTTON_ALT; + } + if (b & 16) { + eventp->bstate |= BUTTON_CTRL; + } } result = (eventp->bstate & REPORT_MOUSE_POSITION) ? TRUE : FALSE; eventp->x = (data.params[1] ? (data.params[1] - 1) : 0);