From 9b5a7b99d33891f0bc664316c643337ac638cbae Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 4 Apr 2022 17:21:16 -0600 Subject: Implement a window history system. This lets the user cycle between past windows. The rules for when a window gets added to the history is the same as when a window is considered the last marked. In fact, now all the last mark does is swap the current window with the previous one in the history. --- src/Internal/Keys.hs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/Internal/Keys.hs') diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs index 6d34c4a..2dd7c37 100644 --- a/src/Internal/Keys.hs +++ b/src/Internal/Keys.hs @@ -290,11 +290,17 @@ keymap = runKeys $ do doc "Shrink the size of the zoom region" $ sendMessage ShrinkZoom + shiftMod $ + doc "Go to the previous window in history." historyPrev + bind xK_k $ do justMod $ doc "Expand the size of the zoom region" $ sendMessage ExpandZoom + shiftMod $ + doc "Go to the next window in history." historyNext + bind xK_l $ do justMod $ doc "Focus the next window in the stack" $ @@ -420,18 +426,19 @@ keymap = runKeys $ do _ -> return () bind xK_p $ do - (justMod -|- noMod) $ mapNextString $ \_ str -> - spawnX $ printf "gxmessage 'typed: \"%s\"\ncodes: \"%s\"\nunicode: รก\n'" - str - (show (map ord str)) + (justMod -|- noMod) $ + doc "Go to the prior window in the history" historyPrev bind xK_t $ do (justMod -|- noMod) $ logs "Test Log" + -- bind xK_n $ do + -- (justMod -|- noMod) $ + -- doc "Take a note" $ + -- spawnX (terminal config ++ " -t Notes -e notes new") bind xK_n $ do (justMod -|- noMod) $ - doc "Take a note" $ - spawnX (terminal config ++ " -t Notes -e notes new") + doc "Go to the next window in the history" historyNext bind xK_c $ do shiftMod $ @@ -589,8 +596,8 @@ mouseMap = runButtons $ do (button4, increaseVolume), (button5, decreaseVolume), (button2, playPause), - (button9, mediaNext), - (button8, mediaPrev), + (button9, historyNext), + (button8, historyPrev), (button6, mediaPrev), (button7, mediaNext) ] -- cgit