Giter Site home page Giter Site logo

Comments (7)

flagarde avatar flagarde commented on June 20, 2024

This need to be fixed indeed. The reason why the first is like this is historical, we cannot change this. The method 2 is to deal this CTL+ALT+F5 for example (not yet all implemented but needed...). So we need to deal with the 2. The CTL key is a mess :). I think I have seen this probem that why I put the comment.

from cpp-terminal.

TobiasWallner avatar TobiasWallner commented on June 20, 2024

should we solve this by

  1. convertign all constructions of key directly to the Metakey + Key alternative
  2. on comparison between keys make Metakey::Ctrl + Key and CTRL_ return true?

Personally I would do the first, because then it would already work for all the ctype.h like functions.

Basically where should we have the extra if?

I tried to find some way to get the key status in linux without sudo rights but to be honest. Linux seems to be really lacking in that regard and I could not find any useful resources except for X11.

Furthermore I would suggest to rename the current Key::Value::Ctrl_<letter> to Key::Value::Legacy_Ctrl_<letter> and add additionally Key::Value::Ctrl_<letter> that correspond to the Metakey + Key alternative

from cpp-terminal.

flagarde avatar flagarde commented on June 20, 2024

I fear we cannot do the first solution because the char we receive it's C0 1to aroud 30 (ANSII) so if we use alternative 2 we cannot match this value and conversion to char would be more difficult (I don't like the convertion and would like not to promote that convertion in the library for the user) but I would like the user to cast it if he want without effort.

Your solution 1 is not possible if you want to respect ctype and if you want to assign same valut to the Ctrl variable. ctype is old and mean mainly C0 C1 characters but there is more like Ctrl+F1 etc. Unless we convert back on forthe the C0 C1 keys.

Solution 2 seems the best solution but I'm still thinking about it. I like the Ctrl_A because it really says what it is it maps a combination keys to a value. What I don't like it more the name of the class Key but I couldn't find a better name. That why I would like to add the option for user to be able to use Ctrl + A that is more closer to the reality.

from cpp-terminal.

flagarde avatar flagarde commented on June 20, 2024

should we solve this by

  1. convertign all constructions of key directly to the Metakey + Key alternative
  2. on comparison between keys make Metakey::Ctrl + Key and CTRL_ return true?

Personally I would do the first, because then it would already work for all the ctype.h like functions.

Basically where should we have the extra if?

I tried to find some way to get the key status in linux without sudo rights but to be honest. Linux seems to be really lacking in that regard and I could not find any useful resources except for X11.

Furthermore I would suggest to rename the current Key::Value::Ctrl_<letter> to Key::Value::Legacy_Ctrl_<letter> and add additionally Key::Value::Ctrl_<letter> that correspond to the Metakey + Key alternative

There is maybe some other alternative than using X11 but it will depend on the terminal capabilities, that why I have not focused on it for now. I tried to solve a big problem I found with the key press that PR thread try to solve. My idea is to be out of the OS magics strange sometimes bugged studs as quick as possible and wrap/change all these mess using standard library stufs and make it cross plarforms. Then we can try to use the terminal capability to have better informations on key presses.

But for now most of the keys are/could be detected. What I would like then to do before this better key detect is mouse move detection. This feature is missing for console game or Graphical Interface into console

from cpp-terminal.

TobiasWallner avatar TobiasWallner commented on June 20, 2024

Just wondering, is Ctrl_A correct or would Ctrl_a be more correct?

from cpp-terminal.

flagarde avatar flagarde commented on June 20, 2024

both are ok I think but i'm not ssure it is good to add both.

from cpp-terminal.

flagarde avatar flagarde commented on June 20, 2024

@TobiasWallner After some consideration I think the Ctrl_A is closer to the keyboard configuration. Most if not all the keyboard have A not a

from cpp-terminal.

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.