Coder Social home page Coder Social logo

Comments (7)

peterbrittain avatar peterbrittain commented on July 23, 2024

Requires new API that is being proposed for v2.0

from asciimatics.

peterbrittain avatar peterbrittain commented on July 23, 2024

Might need current cursor position. Looks like this uses u6-7. See http://unix.stackexchange.com/questions/239271/parse-terminfo-u6-string

from asciimatics.

peterbrittain avatar peterbrittain commented on July 23, 2024

Windows cursor pos from https://msdn.microsoft.com/en-us/library/windows/desktop/ms683171(v=vs.85).aspx

from asciimatics.

peterbrittain avatar peterbrittain commented on July 23, 2024

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.

peterbrittain avatar peterbrittain commented on July 23, 2024

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.

peterbrittain avatar peterbrittain commented on July 23, 2024

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.

peterbrittain avatar peterbrittain commented on July 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.