代码之家  ›  专栏  ›  技术社区  ›  Oleg Pavliv

elisp如何检查是否按下了Shift键

  •  3
  • Oleg Pavliv  · 技术社区  · 17 年前

    我需要检查是否按下了Shift键。 更确切地说,我想根据是否按下Shift键来设置dired开关。

    (defadvice find-file-noselect (around find-file-noselect-set-switches activate)
      (let ((switches dired-listing-switches))
        ;; check if shift is pressed and set or not an "R" switch
        (setq dired-listing-switches "-lhRA")
        ad-do-it
        (setq dired-listing-switches switches)))
    

    1 回复  |  直到 17 年前
        1
  •  5
  •   Community Mohan Dere    9 年前

    重复问题(忽略另一个问题的“窗口”部分)。

    Can I send a keypress to Windows from Emacs?

    你能做的最好的事情(正如你所提到的)是有不同的捷径。它们可以通过资本化来区分。。。例如

    (global-set-key (kbd "C-x C-D") 'dired-with-some-switches)
    (global-set-key (kbd "C-x C-d") 'dired-with-other-switches)