Open
Conversation
clue
reviewed
Dec 20, 2021
Owner
clue
left a comment
There was a problem hiding this comment.
@bgreenacre Thank you for looking into this and providing this high-quality PR! Adding support for SS2 and especially SS3 makes perfect sense!
I noticed a number of minor things in the PR, can you look into this? Also, perhaps it makes sense to update the stdin-codes.php example to showcase this?
Again thank you, keep it up!
| * PM (Privacy Message) | ||
|
|
||
| * SS2 (Single Shift 2) | ||
| this means select the following character form the G2 character set |
| this means select the following character form the G2 character set | ||
|
|
||
| * SS3 (Single Shift 3) | ||
| this means select the following character form the G3 character set |
| } | ||
| } | ||
| } else if ($type === 'ss2' || $type === 'ss3') { | ||
| $data = substr($this->buffer, 0, 3); |
Owner
There was a problem hiding this comment.
Logic looks about right! 👍 This needs an additional check to ensure that 3 bytes are available in the buffer and set $found accordingly (also needs additional tests).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I couldn't get this lib to emit my f1 to f4 keys properly. Or rather they were get emitted as c1 with the last character chopped off. Did some research and found out about ss2 and ss3 control codes. So I added a check for the two types in
ControlCodeParserfor strings starting with^[N(ss2) and^[O(ss3) and to emit them asss2andss3respectively with that extra character.For reference https://en.wikipedia.org/wiki/ANSI_escape_code#Fe_Escape_sequences