Notcurses: Difference between revisions

 
(5 intermediate revisions by the same user not shown)
Line 8: Line 8:
I published a coherent textbook, "[https://www.amazon.com/dp/B086PNVNC9 Hacking the Planet! with Notcurses]", in April 2020. More details are available [[Hacking_The_Planet!_with_Notcurses|here]].
I published a coherent textbook, "[https://www.amazon.com/dp/B086PNVNC9 Hacking the Planet! with Notcurses]", in April 2020. More details are available [[Hacking_The_Planet!_with_Notcurses|here]].


I recorded a [[DANKTECH]] video, "[https://www.youtube.com/watch?v=mOmMcFXdd6k Console sex with Notcurses]" as a gentle intro (its demo has been superseded by the [https://www.youtube.com/watch?v=dcjkezf1ARY 2.3.0 demo]). You can run this same demo on your local machine with <tt>[https://nick-black.com/notcurses/notcurses-demo.1.html notcurses-demo]</tt>.
I recorded a [[DANKTECH]] video, "[https://www.youtube.com/watch?v=mOmMcFXdd6k Console sex with Notcurses]" as a gentle intro (its demo has been superseded by the [https://www.youtube.com/watch?v=dcjkezf1ARY NOTCURSES III demo]). You can run this same demo on your local machine with <tt>[https://nick-black.com/notcurses/notcurses-demo.1.html notcurses-demo]</tt>.


==Features==
==Features==
Line 74: Line 74:
| <tt>NCBLITTER_3x2</tt>
| <tt>NCBLITTER_3x2</tt>
| 3x2->1
| 3x2->1
| Highest quality for most large images. Pixel aspect ratio improves over NCBLITTER_2x2 but is less perfect than NCBLITTER_2x1, leading to slight vertical stretching. Uses Unicode sextants, left and right half blocks, and spaces). Lossy whenever more than two colors are used within a 3x2 pixel square, lossless otherwise (generalized linear interpolation is used for more than two colors).
| Highest quality for most large images. Pixel aspect ratio improves over NCBLITTER_2x2 but is less perfect than NCBLITTER_2x1, leading to slight vertical stretching. Uses Unicode sextants, left and right half blocks, and spaces. Lossy whenever more than two colors are used within a 3x2 pixel square, lossless otherwise (generalized linear interpolation is used for more than two colors).
|-
|-
| <tt>NCBLITTER_4x2</tt>
| <tt>NCBLITTER_4x2</tt>
Line 142: Line 142:


==Input==
==Input==
Notcurses provides input from keyboards and mice. Single Unicode codepoints are received from the keyboard, directly encoded as <tt>char32_t</tt>s. The input system must deal with numerous keyboard signals which do not map to Unicode code points. This includes the keypad arrows and function keys. These "synthesized" codepoints are enumerated in <tt>notcurses.h</tt>, and mapped into the [https://unicode.org/charts/PDF/U100000.pdf Supplementary Private Use Area-B] (U+100000..U+10FFFD). Mouse button events are similarly mapped into the SPUA-B.
Notcurses provides input from keyboards and pointers (mice). Single Unicode codepoints are received from the keyboard, directly encoded as <tt>char32_t</tt>s. The input system must deal with numerous keyboard signals which do not map to Unicode code points. This includes the keypad arrows and function keys. These "synthesized" codepoints are enumerated in <tt>notcurses.h</tt>, and mapped into the [https://unicode.org/charts/PDF/U100000.pdf Supplementary Private Use Area-B] (U+100000..U+10FFFD). Mouse button events are similarly mapped into the SPUA-B.


All events carry a <tt>ncinput</tt> structure with them. For mouse events, the x and y coordinates are reported within this struct. For all events, modifiers (e.g. "Alt") are carried as bools in this struct.
All events carry a <tt>ncinput</tt> structure with them. For mouse events, the x and y coordinates are reported within this struct. For all events, modifiers (e.g. "Alt") are carried as the <tt>modifiers</tt> bitfield in this struct.


==Transparency/Contrasting==
==Transparency/Contrasting==
Line 288: Line 288:
! Release !! Date !! Key features
! Release !! Date !! Key features
|-
|-
| 3.0.0 || late 2021
| [https://github.com/dankamongmen/notcurses/releases/tag/v3.0.0 3.0.0] || 2021-12-01
|
| New input system, kitty keyboard/GPM/XTMODKEYS support
|-
|-
| [https://github.com/dankamongmen/notcurses/releases/tag/v2.4.0 2.4.0] || 2021-09-06
| [https://github.com/dankamongmen/notcurses/releases/tag/v2.4.0 2.4.0] || 2021-09-06