Skip to content

Commit

Permalink
Merge pull request kmonad#906 from jokesper/fix-tapping-in-inner-v3
Browse files Browse the repository at this point in the history
Fix tapping for `tapMacro` and `tapMacroRelease`
  • Loading branch information
slotThe authored Oct 10, 2024
2 parents b3eb93c + f990eae commit e85628b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0)

### Fixed

- Fixed `tapMacro` and `tapMacroRelease` behaviour which was slightly broken in #873 (#906)

## 0.4.3 – 2024-09-11

### Added
Expand Down
4 changes: 2 additions & 2 deletions src/KMonad/Model/Button.hs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ multiTap l bs = onPress' tap' $ go bs
-- | Create a 'Button' that performs a series of taps on press. Note that the
-- last button is only released when the tapMacro itself is released.
tapMacro :: [Button] -> Button
tapMacro bs = mkButton' (go True bs) (pure ()) (go False bs)
tapMacro bs = mkButton' (go False bs) (pure ()) (go True bs)
where
go _ [] = pure ()
go False [b] = press b
Expand All @@ -533,7 +533,7 @@ tapMacro bs = mkButton' (go True bs) (pure ()) (go False bs)
-- | Create a 'Button' that performs a series of taps on press,
-- except for the last Button, which is tapped on release.
tapMacroRelease :: [Button] -> Button
tapMacroRelease bs = mkButton' (go True bs) (pure ()) (go False bs)
tapMacroRelease bs = mkButton' (go False bs) (pure ()) (go True bs)
where
go _ [] = pure ()
go False [b] = awaitMy Release $ tap b >> pure Catch
Expand Down

0 comments on commit e85628b

Please sign in to comment.