Comments (7)
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.
should we solve this by
- convertign all constructions of key directly to the Metakey + Key alternative
- 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.
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.
should we solve this by
- convertign all constructions of key directly to the Metakey + Key alternative
- 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>
toKey::Value::Legacy_Ctrl_<letter>
and add additionallyKey::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.
Just wondering, is Ctrl_A correct or would Ctrl_a be more correct?
from cpp-terminal.
both are ok I think but i'm not ssure it is good to add both.
from cpp-terminal.
@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)
- Flickering HOT 20
- Windows terminal can be turned into `legacy mode` and so crash our ANSII support detection
- example 'kilo' does not support special characters HOT 7
- exception leaking destructor is dangerous HOT 10
- build as shared library, error adding symbols: DSO missing from command line HOT 12
- Compiling the examples with GCC results in errors HOT 7
- Create a list of projects that are using this library HOT 3
- Bug: cpp-terminal crashes if two utf8 are inserted simultaneously HOT 42
- Multiline prompt stopped working on macOS
- Ctrl + I and Tab HOT 6
- Bug: Text Wrap Incompatibility HOT 6
- Bring back the list of other similar libraries HOT 4
- Pressing Ctrl, Alt, Shift creates a copy paste event on windows? HOT 3
- Addition of Metakey and Key results in warning of deprecation HOT 1
- Exception thrown at this line when typeing to fast HOT 7
- mouse sending random characters to the terminal after examples/minimal ends HOT 8
- `std::cin` doesn't read pipe redirection HOT 8
- Issue with file headers HOT 3
- Doctest.h needs to be updated to the latest version - compile error on Ubuntu 22.04 HOT 2
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 cpp-terminal.