Comments (7)
Requires new API that is being proposed for v2.0
from asciimatics.
Might need current cursor position. Looks like this uses u6-7. See http://unix.stackexchange.com/questions/239271/parse-terminfo-u6-string
from asciimatics.
Windows cursor pos from https://msdn.microsoft.com/en-us/library/windows/desktop/ms683171(v=vs.85).aspx
from asciimatics.
Also need to think about relative movement inthis environment - e.g. start of line, up/down one line, etc. That may be possible with a print
method instead of print_at
. But if I do that, can I still support renderers using paint
? Maybe the correct API is to provide no print_at
for direct mode and to make paint
work from the current cursor pos?
from asciimatics.
It appears that I can only really use setupterm() in curses and so have to limit available function (e.g. no input at all). That means an API like:
- print_at
- centre
- palette
- paint
- highlight
- dimensions (using "cols" and "lines" from terminfo)
- is_visible
Plus some other methods that might now make sense if I can break out the classes neatly enough:
- save/restore cursor position (using "sc"/"rc")
- hide cursor (using "civis"/"cnorm")
- fullscreen (using "smcup"/"rmcup")
- clear (using "clear")
- get_current_pos (using "u6"/"u7") - though it's not obvious this is supported on all terminals.
Longer term it might be possible to do the following (but they will be messy to fit into the current APIs):
- print (with relative positions [see cup, hpa and vpa] and colours?)
- cursor movement (with relative motion? - see cub1, cuf1, cuu1, cud1)
- Possibly print_renderer to simplify use of such things...
from asciimatics.
A little more research on how dialog simply overrides stuff inside ncurses leads me to believe that I might be able to use the rmcup
sequence on curses systems to allow full interaction with the normal screen. Feels a bit hacky, but could be a way forwards.
from asciimatics.
Need to look at resizing and extracting state of screen before the app starts a little more closely, but a quick trial script looks like this could give full cursor control and keyboard input, thus giving access to the full existing API.
from asciimatics.
Related Issues (20)
- Fatal Error when Multiple Frames in a scene with widgets HOT 3
- Better docs for callbacks
- RadioButton value equals None when set to False HOT 1
- Asciimatics doesn't print anything. HOT 3
- Custom subprocess integration HOT 2
- Rain test fails randomly HOT 10
- Load another form after initialization HOT 5
- RayCaster sample "swallows" key when commenting out RayCaster effect HOT 6
- DarkGray access on Windows/Powershell? HOT 7
- Automate user inputs HOT 4
- Leave and re-enter asciimatics mode? HOT 2
- Emojis with "hidden characters"? HOT 11
- particles HOT 4
- Mouse Events in Win11 HOT 4
- Implementing Widget's Custom Color Palettes HOT 4
- Can we donate to the project via Paypal? HOT 3
- New release? HOT 3
- Incompatible with Python 3.12 (imp module removed)
- Support multi-line text rolling in a rect HOT 3
- The effect of selecting the check box in version 1.15.0 is different from that in version 1.14.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asciimatics.