Commit Graph

1967 Commits

Author SHA1 Message Date
Jonathan Daugherty
bb0ccad5b5 handleKeyboardEvent -> handleKey, take key/modifiers rather than Vty Event 2022-08-01 13:17:43 -07:00
Jonathan Daugherty
048aaa6643 Keybindings: documentation 2022-08-01 13:08:10 -07:00
Jonathan Daugherty
8267089711 mkKeybindings -> keyDispatcher 2022-08-01 13:06:20 -07:00
Jonathan Daugherty
a50da870de mkKeybindings: use a more natural argument order 2022-08-01 13:03:12 -07:00
Jonathan Daugherty
9451379890 KeyDispatcher: add module haddock 2022-08-01 13:01:50 -07:00
Jonathan Daugherty
02cb6f9a90 KeyDispatcher: section reordering 2022-08-01 12:53:25 -07:00
Jonathan Daugherty
8249d1ea77 KeyHandlerMap -> KeyDispatcher 2022-08-01 12:52:13 -07:00
Jonathan Daugherty
2d5f1c4daa KeyHandlerMap: add more documentation 2022-08-01 12:48:10 -07:00
Jonathan Daugherty
eebf028734 KeyHandlerMap: improve the names of some fields and constructors 2022-08-01 12:38:46 -07:00
Jonathan Daugherty
b97f6e19dc Keybindings.Pretty: add documentation 2022-08-01 12:32:22 -07:00
Jonathan Daugherty
e8557117e7 parseBinding: do not ignore case on parsed base key character 2022-08-01 11:56:25 -07:00
Jonathan Daugherty
276cf22331 Keybindings.Parse: documentation 2022-08-01 11:56:12 -07:00
Jonathan Daugherty
2e30bbe33e Haddock nit 2022-08-01 11:36:00 -07:00
Jonathan Daugherty
b7be977d33 KeyEvents: add documentation 2022-08-01 11:35:16 -07:00
Jonathan Daugherty
57679a8f71 newKeyConfig: use a more natural argument ordering 2022-08-01 11:34:59 -07:00
Jonathan Daugherty
5f35cd0e3e KeyConfig: more documentation improvements 2022-08-01 11:29:18 -07:00
Jonathan Daugherty
d83b5eae94 ToBinding: improve description 2022-08-01 11:25:55 -07:00
Jonathan Daugherty
8a3ea98284 KeyConfig: remove redundant key and char functions, improve modifier internals 2022-08-01 11:25:08 -07:00
Jonathan Daugherty
7651cdd546 KeyConfig: add more documentation 2022-08-01 11:22:05 -07:00
Jonathan Daugherty
d81ce60ffb allActiveBindings: only return default bindings when an event has no configured bindings and has not been set to Unbound 2022-08-01 11:06:05 -07:00
Jonathan Daugherty
eedd503cf2 KeyConfig: make active/default binding query functions symmetric 2022-07-28 19:03:55 -07:00
Jonathan Daugherty
c9963d0429 renderRadio: remove unnecessary hBox 2022-07-28 18:43:26 -07:00
Jonathan Daugherty
db98ec8a73 Merge branch 'master' into refactor/event-state-monad 2022-07-28 18:37:03 -07:00
Jonathan Daugherty
79134f8150
Merge pull request #383 from frasertweedale/refactor/list
refactor some list functions (use listSelectedElementL)
2022-07-28 18:36:40 -07:00
Jonathan Daugherty
23fc05e180 Whitespace 2022-07-28 18:31:52 -07:00
Jonathan Daugherty
02c9acfe64 Forms: style nit 2022-07-28 18:31:18 -07:00
Jonathan Daugherty
e8ed13ee42 Forms: suppress unused lens warning 2022-07-28 18:29:25 -07:00
Fraser Tweedale
6dc25d7904 refactor some list functions
Use listSelectedElementL to simplify the implementation and improve
asymptotics of some list functions.  Introduces some additional
constraints on these functions, so this change requires a major
version bump.

- `listModify`: Improved asymptotics for `Seq`.  Introduces
  `Splittable` and `Semigroup` constraint.

- `listSelectedElement`: Simpler definition.  Asymptotics unchanged.
  Introduces `Semigroup` constraint and strengthens `Foldable`
  constraint to `Traversable`.
2022-07-29 11:25:26 +10:00
Jonathan Daugherty
f1d510f83b Merge branch 'master' into refactor/event-state-monad 2022-07-28 18:16:09 -07:00
Jonathan Daugherty
a46e4520f3
Merge pull request #381 from avh4/patch-1
Update documentation for wide character support
2022-07-28 13:23:29 -07:00
Jonathan Daugherty
0385fa8e07 tests/List.hs: make Semigroup import conditional 2022-07-28 13:10:15 -07:00
Jonathan Daugherty
408129d825 tests/List.hs: style 2022-07-28 13:09:01 -07:00
Jonathan Daugherty
dd8958fc45 listSelectedElementL: style 2022-07-28 13:02:53 -07:00
Jonathan Daugherty
1d8e0832d1
Merge pull request #382 from frasertweedale/feature/selected-element-traversal
add listSelectedElementL Traversal
2022-07-28 09:27:55 -07:00
Fraser Tweedale
896e7243ef add listSelectedElementL Traversal
Add a `Traversal` that targets the selected element (if any).  It is
useful for retrieving, setting, modifying or traversing the selected
element and composes with other optics.  Asymptotics are documented.

It also makes it possible to rewrite some other functions in terms
of `listSelectedElementL`, including:

- `listModify`: Improved asymptotics for some containers, including
  `Seq`.  Introduces `Splittable` and `Semigroup` constraint.

- `listSelectedElement`: Simplifies definition.  Asymptotics
  unchanged.  Introduces `Semigroup` constraint.

Such changes are left for discussion of possible subsequent
implementation.
2022-07-28 23:34:32 +10:00
Aaron VonderHaar
8baa49f29b Update documentation on wide character support to clarify the current recommendation 2022-07-27 21:03:46 -07:00
Jonathan Daugherty
dee90efa8c Remove withLens and withFirst in lieu of a Zoom instance for EventM
This change makes it possible to use the "zoom" function from
microlens-mtl to zoom in on a state field in EventM. This change adds a
re-export of "zoom" to Brick.Types for convenience.
2022-07-26 19:49:29 -07:00
Jonathan Daugherty
e0c70f070a API changes: get rid of InternalSuspendAndResume, make suspendAndResume immediate
This change refactors the internal book-keeping for the Vty context (Vty
handle, event forwarding thread, and Vty builder) so that we could get
rid of the InternalHalt / InternalSuspendAndResume mess. This change
also made suspendAndResume immediate rather than deferring the
suspension of Vty until after the event handler terminated. This may
have important consequences for applications that assumed the function
was not immediate. Now, it will *immediately* shut down the Vty context
and execute the specified action. This leads to a more natural and sane
behavior.

This change also introduced a more generic
"Brick.Main.suspendAndResume'" function that can execute any IO action
and return its result, which is useful when you want to do some work
that has nothing specifically to do with the EventM state type.
2022-07-26 19:03:47 -07:00
Jonathan Daugherty
0b6b562821 Fix comment 2022-07-26 08:56:48 -07:00
Aaron VonderHaar
936d166290
Update documentation for wide character support 2022-07-25 23:30:53 -07:00
Jonathan Daugherty
34f77c4bb7 Comment nit 2022-07-24 07:39:52 -07:00
Jonathan Daugherty
55b95d740b Merge branch 'refactor/event-state-monad' of github.com:jtdaugherty/brick into refactor/event-state-monad 2022-07-24 07:38:36 -07:00
Jonathan Daugherty
3a6f130756 Brick.Types: add nestEventM' and withFirst 2022-07-24 07:38:30 -07:00
Jonathan Daugherty
bf2f6be870 Move Padding type from Brick.Types to Brick.Widgets.Core 2022-07-22 16:07:00 -07:00
Jonathan Daugherty
f2b2586d53 Comment edit 2022-07-22 15:50:06 -07:00
Jonathan Daugherty
b0273b0109 MouseDemo: move Vty handle operations into appStartEvent 2022-07-21 14:22:11 -07:00
Jonathan Daugherty
2838263c22 MouseDemo: whitespace 2022-07-21 14:18:49 -07:00
Jonathan Daugherty
84924f41c1 Docstring edit 2022-07-17 19:08:02 -07:00
Jonathan Daugherty
241b599fd2 Whitespace 2022-07-17 19:07:49 -07:00
Jonathan Daugherty
40f37f62a0 withLens, nestEventM: add docs 2022-07-17 19:06:00 -07:00