mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Merge pull request #850 from slotThe/fix/prompt-ignores-left
X.Prompt: Execute keypress when it has an action associated to it
This commit is contained in:
commit
e75eb16a93
@ -708,18 +708,21 @@ handleMain stroke@(keysym, keystr) = \case
|
||||
getCurrentCompletions >>= handleCompletionMain Next
|
||||
| (keymask, keysym) == prevCompKey ->
|
||||
getCurrentCompletions >>= handleCompletionMain Prev
|
||||
| otherwise -> unless (isModifier stroke) $ do
|
||||
| otherwise -> do
|
||||
keymap <- gets (promptKeymap . config)
|
||||
let mbAction = M.lookup (keymask, keysym) keymap
|
||||
-- Either run when we can insert a valid character, or the
|
||||
-- pressed key has an action associated to it.
|
||||
unless (isModifier stroke && isNothing mbAction) $ do
|
||||
setCurrentCompletions Nothing
|
||||
if keysym == modeKey
|
||||
then modify setNextMode >> updateWindows
|
||||
else handleInput keymask
|
||||
else handleInput keymask mbAction
|
||||
event -> handleOther stroke event
|
||||
where
|
||||
-- Prompt input handler for the main loop.
|
||||
handleInput :: KeyMask -> XP ()
|
||||
handleInput keymask = do
|
||||
keymap <- gets (promptKeymap . config)
|
||||
case M.lookup (keymask,keysym) keymap of
|
||||
handleInput :: KeyMask -> Maybe (XP ()) -> XP ()
|
||||
handleInput keymask = \case
|
||||
Just action -> action >> updateWindows
|
||||
Nothing -> when (keymask .&. controlMask == 0) $ do
|
||||
insertString $ utf8Decode keystr
|
||||
|
Loading…
x
Reference in New Issue
Block a user