Patch 9.0.0802
Problem:    MS-Windows: cannot map console mouse scroll events.
Solution:   Change CSI to K_SPECIAL when checking for a mapping. (Christopher
            Plewright, closes #11410)
Files:      src/getchar.c, src/os_win32.c


*** ../vim-9.0.0801/src/getchar.c       2022-10-19 11:54:42.929834804 +0100
--- src/getchar.c       2022-10-20 13:10:44.990212485 +0100
***************
*** 2520,2531 ****
            && State != MODE_CONFIRM
            && !at_ins_compl_key())
      {
! #ifdef FEAT_GUI
!       if (gui.in_use && tb_c1 == CSI && typebuf.tb_len >= 2
!               && typebuf.tb_buf[typebuf.tb_off + 1] == KS_MODIFIER)
        {
            // The GUI code sends CSI KS_MODIFIER {flags}, but mappings expect
            // K_SPECIAL KS_MODIFIER {flags}.
            tb_c1 = K_SPECIAL;
        }
  #endif
--- 2520,2548 ----
            && State != MODE_CONFIRM
            && !at_ins_compl_key())
      {
! #if defined(FEAT_GUI) || defined(MSWIN)
!       if (tb_c1 == CSI
! # if !defined(MSWIN)
!               && gui.in_use
! # endif
!               && typebuf.tb_len >= 2
!               && (typebuf.tb_buf[typebuf.tb_off + 1] == KS_MODIFIER
! # if defined(MSWIN)
!                   || (typebuf.tb_len >= 3
!                     && typebuf.tb_buf[typebuf.tb_off + 1] == KS_EXTRA
!                     && (typebuf.tb_buf[typebuf.tb_off + 2] == KE_MOUSEUP
!                       || typebuf.tb_buf[typebuf.tb_off + 2] == KE_MOUSEDOWN
!                       || typebuf.tb_buf[typebuf.tb_off + 2] == KE_MOUSELEFT
!                       || typebuf.tb_buf[typebuf.tb_off + 2] == KE_MOUSERIGHT)
!                      )
! # endif
!                  )
!          )
        {
            // The GUI code sends CSI KS_MODIFIER {flags}, but mappings expect
            // K_SPECIAL KS_MODIFIER {flags}.
+           // MS-Windows sends mouse scroll events CSI KS_EXTRA {what}, but
+           // mappings expect K_SPECIAL KS_EXTRA {what}.
            tb_c1 = K_SPECIAL;
        }
  #endif
***************
*** 2568,2574 ****
                    && (mp->m_mode & local_State)
                    && !(mp->m_simplified && seenModifyOtherKeys
                                                     && typebuf.tb_maplen == 0)
!                   && ((mp->m_mode & MODE_LANGMAP) == 0 || typebuf.tb_maplen 
== 0))
            {
  #ifdef FEAT_LANGMAP
                int     nomap = nolmaplen;
--- 2585,2592 ----
                    && (mp->m_mode & local_State)
                    && !(mp->m_simplified && seenModifyOtherKeys
                                                     && typebuf.tb_maplen == 0)
!                   && ((mp->m_mode & MODE_LANGMAP) == 0
!                                                   || typebuf.tb_maplen == 0))
            {
  #ifdef FEAT_LANGMAP
                int     nomap = nolmaplen;
*** ../vim-9.0.0801/src/os_win32.c      2022-10-19 11:54:42.929834804 +0100
--- src/os_win32.c      2022-10-20 13:05:32.642293644 +0100
***************
*** 1265,1271 ****
  #ifdef FEAT_PROP_POPUP
      int lcol = g_xMouse;
      int lrow = g_yMouse;
!     wp = mouse_find_win(&lrow, &lcol, FAIL_POPUP);
      if (wp != NULL && popup_is_popup(wp))
      {
        g_nMouseClick = -1;
--- 1265,1271 ----
  #ifdef FEAT_PROP_POPUP
      int lcol = g_xMouse;
      int lrow = g_yMouse;
!     wp = mouse_find_win(&lrow, &lcol, FIND_POPUP);
      if (wp != NULL && popup_is_popup(wp))
      {
        g_nMouseClick = -1;
*** ../vim-9.0.0801/src/version.c       2022-10-19 20:07:06.301844748 +0100
--- src/version.c       2022-10-20 13:03:47.502325417 +0100
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     802,
  /**/

-- 
The most powerful force in the universe is gossip.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221020121159.CFB1E1C18CF%40moolenaar.net.

Raspunde prin e-mail lui