summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/tv.hs14
1 files changed, 12 insertions, 2 deletions
diff --git a/config/tv.hs b/config/tv.hs
index f7bdd90..2d57678 100644
--- a/config/tv.hs
+++ b/config/tv.hs
@@ -12,6 +12,8 @@ import Much.Core
import Much.State
import Much.TreeView
import Scanner
+import System.Environment (getEnv)
+import System.IO.Unsafe (unsafePerformIO)
import Text.Hyphenation
import Text.LineBreak
import qualified Data.Tree as Tree
@@ -19,6 +21,14 @@ import qualified Data.Tree.Zipper as Z
import qualified Much.API
import qualified Notmuch.Message as Notmuch
+
+scrollLines :: Int
+scrollLines =
+ if unsafePerformIO (getEnv "TOUCHSCREEN") == "1" then
+ 1
+ else
+ 3
+
main :: IO ()
main =
mainWithState def
@@ -110,7 +120,7 @@ myKeymap s = displayKey s
myMousemap :: Scan -> State -> IO State
myMousemap ScanMouse{mouseButton=1,mouseY=y} = defaultMouse1Click y
myMousemap ScanMouse{mouseButton=3,mouseY=y} = \q -> defaultMouse1Click y q >>= toggleFold
-myMousemap ScanMouse{mouseButton=4} = moveTreeDown 3
-myMousemap ScanMouse{mouseButton=5} = moveTreeUp 3
+myMousemap ScanMouse{mouseButton=4} = moveTreeDown scrollLines
+myMousemap ScanMouse{mouseButton=5} = moveTreeUp scrollLines
myMousemap ScanMouse{mouseButton=0} = return
myMousemap info = displayMouse info