Loading ...
Sorry, an error occurred while loading the content.

RE: Mouse control in a "Quick Edit mode" Windows console

Expand Messages
  • Craig Barkhouse
    ... It s possible to programmatically toggle QuickEdit mode. I think it would be quite reasonable for Vim to disable QuickEdit mode so that it has more
    Message 1 of 13 , Sep 1, 2010
    • 0 Attachment
      > On Aug 13, 10:35 pm, Bram Moolenaar <B...@...> wrote:
      >
      > > What system has this mode?  My XP system only has Edit/Mark,
      > > Edit/Paste and thelike.
      > >
      > Thank you for your quick answer.
      > I have Windows XP SP3 (French version).
      > Clicking the "C:\" icon at the left top corner of a cmd.exe console window
      > proposes Properties/Options/Edition Options with Quick Edit mode and Insert
      > mode check boxes.
      > With Quick Edit mode activated, copy/paste is simply obtained by double-click +
      > right mouse twice (comparable to unix behaviour).
      >
      > You mention yourself this "Quick Edit mode" in Help/os_win32.txt, line
      > 112 !
      >
      > I am afraid this option completely captures mouse events.
      >
      > Best regards
      >
      > Jean Johner


      It's possible to programmatically toggle QuickEdit mode. I think it would be quite reasonable for Vim to disable QuickEdit mode so that it has more complete control over the mouse. See if you like the following ptach. It disables QuickEdit when entering termcap mode if the mouse is enabled; and restores QuickEdit to its original value when leaving termcap mode.


      diff.exe -c3 \TEMP\os_win32.c os_win32.c
      *** \TEMP\os_win32.c 2010-08-19 12:22:28.580270500 -0700
      --- os_win32.c 2010-09-01 14:20:08.999897000 -0700
      ***************
      *** 1962,1967 ****
      --- 1962,1969 ----
      static ConsoleBuffer g_cbNonTermcap = { 0 };
      static ConsoleBuffer g_cbTermcap = { 0 };

      + static DWORD g_cmiNonTermcap = 0;
      +
      #ifdef FEAT_TITLE
      #ifdef __BORLANDC__
      typedef HWND (__stdcall *GETCONSOLEWINDOWPROC)(VOID);
      ***************
      *** 3433,3438 ****
      --- 3435,3441 ----
      return;

      SaveConsoleBuffer(&g_cbNonTermcap);
      + GetConsoleMode(g_hConIn, &g_cmiNonTermcap);

      if (g_cbTermcap.IsValid)
      {
      ***************
      *** 3462,3476 ****
      resettitle();
      #endif

      ! GetConsoleMode(g_hConIn, &cmodein);
      #ifdef FEAT_MOUSE
      if (g_fMouseActive)
      cmodein |= ENABLE_MOUSE_INPUT;
      else
      cmodein &= ~ENABLE_MOUSE_INPUT;
      #endif
      cmodein |= ENABLE_WINDOW_INPUT;
      ! SetConsoleMode(g_hConIn, cmodein);

      redraw_later_clear();
      g_fTermcapMode = TRUE;
      --- 3465,3484 ----
      resettitle();
      #endif

      ! cmodein = g_cmiNonTermcap;
      #ifdef FEAT_MOUSE
      if (g_fMouseActive)
      + {
      cmodein |= ENABLE_MOUSE_INPUT;
      + cmodein &= ~ENABLE_QUICK_EDIT_MODE;
      + }
      else
      + {
      cmodein &= ~ENABLE_MOUSE_INPUT;
      + }
      #endif
      cmodein |= ENABLE_WINDOW_INPUT;
      ! SetConsoleMode(g_hConIn, cmodein | ENABLE_EXTENDED_FLAGS);

      redraw_later_clear();
      g_fTermcapMode = TRUE;
      ***************
      *** 3483,3489 ****
      static void
      termcap_mode_end(void)
      {
      - DWORD cmodein;
      ConsoleBuffer *cb;
      COORD coord;
      DWORD dwDummy;
      --- 3491,3496 ----
      ***************
      *** 3493,3501 ****

      SaveConsoleBuffer(&g_cbTermcap);

      ! GetConsoleMode(g_hConIn, &cmodein);
      ! cmodein &= ~(ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT);
      ! SetConsoleMode(g_hConIn, cmodein);

      #ifdef FEAT_RESTORE_ORIG_SCREEN
      cb = exiting ? &g_cbOrig : &g_cbNonTermcap;
      --- 3500,3506 ----

      SaveConsoleBuffer(&g_cbTermcap);

      ! SetConsoleMode(g_hConIn, g_cmiNonTermcap | ENABLE_EXTENDED_FLAGS);

      #ifdef FEAT_RESTORE_ORIG_SCREEN
      cb = exiting ? &g_cbOrig : &g_cbNonTermcap;

      --
      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
    • Jean Johner
      ... So a code modification could solve the problem ! Congratulations Craig. Best regards Jean Johner -- You received this message from the vim_dev maillist.
      Message 2 of 13 , Sep 2, 2010
      • 0 Attachment
        On Sep 1, 11:39 pm, Craig Barkhouse <crai...@...> wrote:
        >
        > It's possible to programmatically toggle QuickEdit mode.  I think it would be quite reasonable for Vim to disable QuickEdit mode so that it has more complete control over the mouse.  See if you like the following ptach.  It disables QuickEdit when entering termcap mode if the mouse is enabled; and restores QuickEdit to its original value when leaving termcap mode.


        So a code modification could solve the problem !

        Congratulations Craig.

        Best regards

        Jean Johner

        --
        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
      Your message has been successfully submitted and would be delivered to recipients shortly.