]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_mouse.c
ncurses 6.1 - patch 20180922
[ncurses.git] / ncurses / base / lib_mouse.c
index 8a0e4c1f32320e7fd6eed52aa7785b847ca2b641..f703a24f40f35adff9cdedc38de9230a3190ac56 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.176 2017/11/18 22:12:06 Vassili.Courzakis Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.177 2018/09/22 19:54:21 tom Exp $")
 
 #include <tic.h>
 
@@ -956,6 +956,7 @@ decode_X10_bstate(SCREEN *sp, MEVENT * eventp, unsigned intro)
 {
     bool result;
 
+    _tracef("decode_X10_bstate %#x", intro);
     eventp->bstate = 0;
 
     if (!handle_wheel(sp, eventp, (int) intro, (intro & 96) == 96)) {
@@ -1276,6 +1277,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);