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

Patch: hotkeys in GUI dialogs

Expand Messages
  • Dan Sandler
    For your consideration, my first Vim patch: http://wiki.macvim.org/wiki/VimPatches/DialogHotKeys It s always really bugged me that I have to reach for the
    Message 1 of 3 , Sep 10, 2007
    • 0 Attachment
      For your consideration, my first Vim patch:

      http://wiki.macvim.org/wiki/VimPatches/DialogHotKeys

      It's always really bugged me that I have to reach for the mouse to
      dismiss a GUI dialog (e.g.: you bang out a quick script and pause
      momentarily to :!chmod 755 % -- now you have to stop and deal with the
      resulting file-has-changed dialog). So I added support for the same
      hotkeys that work in console-mode dialogs. (There's no easy way to
      show the hotkeys in the dialog, short of doing the same (P)arenthesis
      trick used in console, so for now you have to just know what the keys
      are.)

      [Implementation notes: When gui_mch_dialog scans the names of all the
      buttons to be added to the dialog, instead of simply skipping over the
      hotkey char, it now stuffs the control index into a 256-slot array
      (indexed by the char_u of the hotkey itself). To catch keystrokes when
      the dialog is up, the new function DialogHotkeyFilterProc (supplied as
      a modal filter callback to ModalDialog()) checks keyDown and autoKey
      keycodes against the hotkey table to see if a button exists to match
      the keystroke.]

      Thoughts?

      Thanks,
      --ds

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... Great, thanks for making this. I wonder if we should include this in the current version of Vim or that it can be included in the upcoming completely
      Message 2 of 3 , Sep 11, 2007
      • 0 Attachment
        Dan Sandler wrote:

        > For your consideration, my first Vim patch:
        >
        > http://wiki.macvim.org/wiki/VimPatches/DialogHotKeys
        >
        > It's always really bugged me that I have to reach for the mouse to
        > dismiss a GUI dialog (e.g.: you bang out a quick script and pause
        > momentarily to :!chmod 755 % -- now you have to stop and deal with the
        > resulting file-has-changed dialog). So I added support for the same
        > hotkeys that work in console-mode dialogs. (There's no easy way to
        > show the hotkeys in the dialog, short of doing the same (P)arenthesis
        > trick used in console, so for now you have to just know what the keys
        > are.)
        >
        > [Implementation notes: When gui_mch_dialog scans the names of all the
        > buttons to be added to the dialog, instead of simply skipping over the
        > hotkey char, it now stuffs the control index into a 256-slot array
        > (indexed by the char_u of the hotkey itself). To catch keystrokes when
        > the dialog is up, the new function DialogHotkeyFilterProc (supplied as
        > a modal filter callback to ModalDialog()) checks keyDown and autoKey
        > keycodes against the hotkey table to see if a button exists to match
        > the keystroke.]
        >
        > Thoughts?

        Great, thanks for making this.

        I wonder if we should include this in the current version of Vim or that
        it can be included in the upcoming completely updated version.

        --
        [clop clop]
        MORTICIAN: Who's that then?
        CUSTOMER: I don't know.
        MORTICIAN: Must be a king.
        CUSTOMER: Why?
        MORTICIAN: He hasn't got shit all over him.
        The Quest for the Holy Grail (Monty Python)

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Nico Weber
        ... Bjorn s MacVim already has keyboard support for the dialogs (albeit keyboard shortcuts which are consistent with the rest of the mac gui). Since this is
        Message 3 of 3 , Sep 11, 2007
        • 0 Attachment
          > I wonder if we should include this in the current version of Vim or
          > that
          > it can be included in the upcoming completely updated version.

          Bjorn's MacVim already has keyboard support for the dialogs (albeit
          keyboard shortcuts which are consistent with the rest of the mac
          gui). Since this is based on Jigod's code, his version might already
          have this too. Nothing wrong with adding it to the carbon version,
          though ;-)

          Nico


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        Your message has been successfully submitted and would be delivered to recipients shortly.