]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_mouse.c
ncurses 6.1 - patch 20180923
[ncurses.git] / ncurses / base / lib_mouse.c
index 61ec3c8b71160baedc7ff32089da66f12ae686c9..ed58148ba455d1825818a467ec4322ff0622a37f 100644 (file)
@@ -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 <tic.h>
 
@@ -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);