I need to check if the Shift key is pressed. More precisely, I would like to set the Dired Switch depending on whether the Shift key is pressed.
(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)))
Of course, I may have different shortcuts for different switches, but I would like to dynamically change my switches when choosing a directory for dired.
source
share