help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Behavior of M-x and A-x


From: Lennart Borgman (gmail)
Subject: Re: Behavior of M-x and A-x
Date: Tue, 12 Aug 2008 14:13:11 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Xah wrote:
Xah wrote:
; setting the PC keyboard's various keys to Super or Hyper
(setq w32-pass-lwindow-to-system nil
      w32-pass-rwindow-to-system nil
      w32-pass-apps-to-system nil
      w32-lwindow-modifier 'super ;; Left Windows key
      w32-rwindow-modifier 'super ;; Right Windows key
      w32-apps-modifier 'hyper) ;; Menu key

Lennart Borgman wrote:

Please note that using lwindow/rwindow like this does not work for all
key sequences unless you are using the patched Emacs+EmacsW32.

What is the proper way to set it on Windows?


The only thing that the patched version really offers in this regards is the possibility to actually avoid sending lwindow etc to the system:

LRESULT
CALLBACK
LowLevelKeyboardProc(INT nCode, WPARAM wParam, LPARAM lParam)
{
...
            case VK_LWIN:
              {
                bHandle = NILP(Vw32_pass_lwindow_to_system);
                break;
              }
            case VK_RWIN:
              {
                bHandle = NILP(Vw32_pass_rwindow_to_system);
                break;
              }
            case VK_CAPITAL:
              {
                bHandle = NILP(Vw32_enable_caps_lock);
                break;
              }
            case VK_NUMLOCK:
              {
                bHandle = NILP(Vw32_enable_num_lock);
                break;
              }
            case VK_MENU:
            case VK_LMENU:
            case VK_RMENU:
              {
                bHandle = NILP(Vw32_pass_alt_to_system);
                break;
              }
      if (bHandle) {
        // Just to be sure check we are in the right thread
        if (GetCurrentThreadId() == dwWindowsThreadId) {
          // Do we have keyboard focus?
          HWND hwnd = GetFocus();
          if (0 != hwnd) {
            SendMessage (hwnd, msg, wParamMsg, lParamMsg);
            return TRUE;
          }
        }
      }
    }
  HHOOK hhook; return CallNextHookEx(hhook, nCode, wParam, lParam);
}


And then it also offers easy way to set things up up, see w32-meta.el that comes with the patched Emacs+EmacsW32.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]