Implement "tab" button in terminal

This commit is contained in:
2025-08-17 00:12:05 +01:00
parent 76b6cda19b
commit 24027367dc
7 changed files with 43 additions and 29 deletions
+6
View File
@@ -386,11 +386,17 @@ updateKeysInTerminal tmid u =
& doTextInputOverUniverse
(uvWorld . cWorld . lWorld . terminals . ix tmid . tmStatus . tiText)
& checkEndStatus
& tryTabComplete
where
checkEndStatus
| u ^. uvWorld . input . pressedKeys . at ScancodeReturn == Just 0 =
uvWorld %~ terminalReturnEffect tmid
| otherwise = id
tryTabComplete
| u ^. uvWorld . input . pressedKeys . at ScancodeTab == Just 0 = fromMaybe id $ do
s <- u ^? uvWorld . cWorld . lWorld . terminals . ix tmid . tmStatus . tiText
return $ uvWorld . cWorld . lWorld . terminals . ix tmid %~ tabComplete s
| otherwise = id
updateKeyInGame :: Universe -> Scancode -> Int -> Universe
updateKeyInGame uv sc pt = case pt of