Coder Social home page Coder Social logo

Comments (5)

nsf avatar nsf commented on May 18, 2024

Termbox doesn't support them. Any unknown esc key sequence (ctrl+arrow keys are esc seqs) is recognized as esc and characters which follow. The reason for this is that termbox supports only a common subset of functionality all most popular terminals support.

There is no way to avoid that behaviour, unless you simply ignore esc. I've said that many times and I'm happy to repeat: terminals suck when it comes to input, you have to live with it or use something else than a terminal. That's why editors like vim and emacs have a very restricted set of bindings by default. Both vim and emacs don't even use arrow keys mainly and recommend to use other keys (C-f C-b C-n C-p or hjkl). Yes, they do support it eventually, but as I said, not all terminals handle ctrl+arrow keys properly.

I'm strongly against building interfaces which aren't portable (i.e. don't work on all platforms). Yes, termbox became already that kind of a library, where on linux there are 256 colors and on windows there is no such thing. Initially termbox was born because I tried doing portable stuff (linux and windows) using some w32 curses port and it simply didn't work well.

So, whatever, I don't know what to do about it.

from termbox-go.

nsf avatar nsf commented on May 18, 2024

I'm adding raw events to the termbox. See: #65

And the commit: 54b74d0

Technically, it's a way to handle Ctrl+Arrow keys. Maybe not the best one, but it is.

from termbox-go.

gdamore avatar gdamore commented on May 18, 2024

Control+Arrow can't work on most terminals -- there is no escape sequence defined for it, and so its generally impossible outside of Windows.

from termbox-go.

Limero avatar Limero commented on May 18, 2024

Control+arrow works on all terminal emulators I've tried (on Linux) and it's supported in programs like vim. Can these keys be added to termbox-go so it's easy to work with?

from termbox-go.

nsf avatar nsf commented on May 18, 2024

Termbox is no longer maintained, you can try this lib: https://github.com/gdamore/tcell

It might support what you're looking for.

from termbox-go.

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.