adding check if char == '-', if so not using as modifier for keypress#105
adding check if char == '-', if so not using as modifier for keypress#105sheik wants to merge 2 commits intogioui:mainfrom
Conversation
|
Thanks for the PR! Please sign off your commit message. |
Fixes: https://todo.sr.ht/~eliasnaur/gio/432 Signed-off-by: Jeff Aigner <enumeration@gmail.com>
|
Done. Please let me know if I've done something incorrectly 🤪 |
whereswaldon
left a comment
There was a problem hiding this comment.
I think there're some unhanded edge cases, but thanks for tackling this!
io/key/key.go
Outdated
| if chord == "-" { | ||
| modSet, keySet = "", chord | ||
| } else { | ||
| modSet, keySet = chord[:sep], chord[sep+1:] | ||
| } |
There was a problem hiding this comment.
Perhaps I am misreading, but this seems like it would only work to bind to literal presses of -. It doesn't handle modifier keys in combination with - such as Short-- or Ctrl--. Here's a playground demonstrating some of the failure cases. I think whatever we do needs to handle all of the ones I put in the playground, probably by detecting when the final character is - and doing special processing.
There was a problem hiding this comment.
ahh good point. I will be implementing these in my app soon so I'll update the PR when I do so.
|
LGTM, but an addition to |
whereswaldon
left a comment
There was a problem hiding this comment.
Nice work! A test would, as @eliasnaur says, be appreciated. :D
0d543a0 to
1686874
Compare
67c77c9 to
46cc311
Compare
f8029f2 to
026d3f9
Compare
072d68c to
e8ba786
Compare
3d36537 to
74ccc9c
Compare
e8d63ad to
c250d7d
Compare
No description provided.