Commit Graph

133 Commits

Author SHA1 Message Date
d
160b1c8bbc Added Home, End, PageUp, PageDown events.
Added handling for Home and End for input component
2021-03-28 18:25:16 +02:00
Arthur Sonzogni
6ed5051cfc
Add documentation about ./example/util/print_key_press (#73)
Fixed: https://github.com/ArthurSonzogni/FTXUI/issues/72
2021-02-13 20:00:00 +01:00
Arthur Sonzogni
406355df8c
Fix parsing of keys that are prefix of others. (#58)
The ESC key generates sequences that are prefix of others. For instance:
- ESC => [27]
- F1 =>  [27, 79, 8]

As a result, we can't generate the ESC event when receiving [27],
because it might be the start of the [27, 79, 8] sequence (or not).

Application usually applies a timeout to help detecting the ESC key.
This patch introduce a timeout. It is set to 50ms.

Bug: https://github.com/ArthurSonzogni/FTXUI/issues/55
2020-10-25 01:57:56 +02:00
Mike Wallio
c13621d1f9
Make cursor position public state (#57) 2020-10-24 16:48:59 +02:00
Mike Wallio
1cb08fd606
Fix event const correctness (#56) 2020-10-24 16:47:03 +02:00
ArthurSonzogni
606e0efdfe Implement Input::on_change. 2020-09-20 11:47:06 +02:00
ArthurSonzogni
5291f660ca Automatically fix style. 2020-09-07 11:25:50 +02:00
ArthurSonzogni
5a8ed208da Add the Button component. 2020-08-28 23:54:25 +02:00
ArthurSonzogni
81d79d311d Add TakeFocus and SetActiveChild.
This allows developers to set child children component must be the
currently active/focused one.

This can be used to "control" where the focus is, without user
interactions.
2020-08-28 23:54:25 +02:00
ArthurSonzogni
114ab4ae2a Add more documentation. 2020-08-28 23:54:25 +02:00
ArthurSonzogni
f2dc080a35 Variou details:
- Put the MIT copyright at the end.
- Move the directory /other -> tools
- Various improvements.
2020-08-28 23:54:25 +02:00
vedantparanjape
33a970530b Added on_enter() method to toggle
component
2020-08-05 01:34:46 +02:00
ArthurSonzogni
61ca97840b Fix default char for checkbox and radiobox on Windows.
This addresses:
https://github.com/ArthurSonzogni/FTXUI/issues/27
2020-07-21 01:22:42 +02:00
ArthurSonzogni
883b34503d Add Receiver->HasPending() 2020-05-25 03:12:09 +02:00
ArthurSonzogni
76fc52441f Implement "alternative screen".
Apply this option automatically for "fullscreen" screen. Keep it
disabled for the other modes.

This fixes issue:
https://github.com/GiuseppeCesarano/just-fast/issues/2
2020-05-02 20:39:56 +02:00
ArthurSonzogni
f506be941d Add automatic formatting and license. 2020-04-19 21:01:09 +02:00
ArthurSonzogni
a09ebcc442 Fix bug with container on Windows.
This fix the bug from:
https://github.com/ArthurSonzogni/FTXUI/pull/11

About:
~~~
Bug: Focus handling not working

in the examples (e.g. checkbox.cpp) I can toggle the individual
checkboxes but I cannot move between items, I tried to understand the
focus implementation but am I unsure which keypresses would move focus
between different components
~~~
2020-04-17 01:15:17 +02:00
ArthurSonzogni
76b216dd5e Run test on travis. 2020-04-16 23:21:06 +02:00
ArthurSonzogni
fce29a03b3 Run clang-format. 2020-03-27 01:42:46 +01:00
ArthurSonzogni
6e7b4526a0 Add ReceiverTest.
And fix a small bug with the Receiver not eating all the input.
2020-03-27 01:01:37 +01:00
Mikael Olenfalk
2c82a4bf31 Remove unused file 2020-03-25 08:54:16 +01:00
ArthurSonzogni
5fc5766f1e Add Windows input.
Co-authored-by: Mikael Olenfalk <mikael@olenfalk.se>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
2020-03-25 02:24:43 +01:00
ArthurSonzogni
0a7b556a12 Switch name Producer/Consumer -> Sender/Receiver
The producer/consumer was created for:
https://github.com/ArthurSonzogni/FTXUI/pull/11

This patch makes rename everything from Producer/Consumer toward
Sender/Receiver.
2020-03-25 00:07:41 +01:00
ArthurSonzogni
09a1b16613 Add a Producer/Consumer system.
It allow you to create the two end of a pipe: A producer and consumer.
The producer can be moved into another thread.
Several producer can be created if necessary.

This will ease merging:
https://github.com/ArthurSonzogni/FTXUI/pull/11
2020-03-24 23:42:17 +01:00
ArthurSonzogni
493e734680 Set clang-format macro indent.
1) Set clang-format macro indent.
2) Run clang-format on every files.
2020-03-23 21:26:00 +01:00
ArthurSonzogni
22f8f0d3b7 Using TAB key event.
A key event that makes use of TAB key to cycle the elements.

Co-authored-by: Trim Bresilla <trim.bresilla@gmail.com>"
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
2019-11-01 19:54:16 +01:00
ArthurSonzogni
e1efcf2d97 Make DEL to be a special character. 2019-07-02 23:09:20 +02:00
ArthurSonzogni
32871fcc6b Add -Wextra 2019-06-30 23:59:27 +02:00
ArthurSonzogni
8b79b3af99 Fix compilation errors in clang. 2019-06-30 10:11:37 +02:00
ArthurSonzogni
86c3b60a6f Move the cursor to the input location.
Most CJK users use IME (input method) to type CJK characters. They need
the cursor to be at the correct location, not in the bottom right
corner.

This CL does:
 * Move the cursor the focus() element.
 * Hide the cursor (and show it at exit)
 * Intercept SIGINT to guarantee proper cleanup all the time.

This should fix the second issue mentionned on:
https://github.com/ArthurSonzogni/FTXUI/issues/2
2019-06-29 18:52:58 +02:00
ArthurSonzogni
001a0ae925 Add UTF8 support and a better xterm parsing.
This fixes: https://github.com/ArthurSonzogni/FTXUI/issues/2
2019-06-23 17:52:31 +02:00
ArthurSonzogni
15da9cdc18 Improve ScreenInteractive wait function. 2019-02-02 16:59:08 +01:00
ArthurSonzogni
ef0de8d873 Add support for nxxm.
[nxxm](https://nxxm.github.io)
2019-02-02 02:25:06 +01:00