Code Monkey home page Code Monkey logo

Comments (4)

jtdaugherty avatar jtdaugherty commented on July 30, 2024

Unfortunately this behavior depends almost entirely on your terminal emulator of choice and the active termcap settings; to see what I mean you might consider trying different terminal emulators and different modifier key combinations.

In the particular case of C-m and Enter, the value for C-m is equivalent to Enter so there isn't a way to distinguish. This is also true of Tab and C-i. So from that perspective, seeing KEnter when C-m is pressed is expected behavior.

As examples of this kind of behavior, these pages might be illuminating:

http://askubuntu.com/questions/441744/pressing-enter-produces-m-instead-of-a-newline
http://stackoverflow.com/questions/598113/can-terminals-detect-shift-enter-or-control-enter

Sadly, terminal application programmers typically need to select control-key combinations that are likely to work on a wide variety of terminal emulators to avoid this problem.

from brick.

AndrewRademacher avatar AndrewRademacher commented on July 30, 2024

Sad indeed. Thanks for the heads up.

from brick.

hramrach avatar hramrach commented on July 30, 2024

Thanks for looking into this.

Regarding the key mapping - aren't key mappings in some database so applications know what to expect on which terminal?

If not how is anything ever supposed to work on a terminal?

Or is that why vi uses key sequences rather than modifiers most of the time?

Because the modifiers break?

from brick.

jtdaugherty avatar jtdaugherty commented on July 30, 2024

@hramrach - yes, termcap is the database you mentioned. Still, that is not necessarily enough to make this work for all emulators and all modifier key combinations. It might be something that @coreyoconnor could address by making changes to vty (which brick uses to handle keyboard input events), though.

from brick.

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.