-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend Keycode up to 464. #475
Conversation
Fixes the "tag (464) is outside of enumeration's range" issue .
I have a Keychron K2 (Version 2 / JIS) this has a fn key like Varmilo keyboard too. Of course I got same error therefore I need his patch to fix this problem. |
I think the point is that, internally, we are introducing a lot of new data constructors simply to, in reality, support one more key. Since it apparently never got merged into |
It seems that it would resolve the issue on Linux. But as I understand that this will only compile under Linux (see this comment). If it can be made a cross-platform solution, it would be great! |
On Sun, Feb 06 2022 11:08, Ildar Ahmadullin wrote:
It seems that it would resolve the issue on Linux. But as I understand
that this will only compile under Linux (see [this
comment](#72 (comment))).
If it can be made a cross-platform solution, it would be great!
Mh, have you tested this? I don't see why it would be GNU/Linux only
|
No, I didn't. I have an Ubuntu machine, and on Linux it seems to work (judging by comments this and this). I think I can try to test on Windows a bit later (some next days). But that commit (731bda0) doesn't belong to any branch, so I cannot pull it. If I'm not missing anything, it seems that somebody who has this commit locally in a branch has to push this branch to GitHub. |
You can probably just apply the patch itself (I believe it doesn't quite apply anymore, but fixing this should be easy) |
My apologies for the long reply. I tried to apply that patch, but the source had been changed since, and the lines that should be changed in the patch were changed in the source as well. I'm not a Haskell programmer, and I couldn't figure out how to do it correctly. In the original patch this line in src/KMonad/Keyboard/Types.hs
should have been replaced with
But now the original line became
What should it be replaced with? |
So, with the huge caveat that:
The change that might work would be something like keycodeP = choice
[ prefix (char '&') *> ((Keycode . fromIntegral) <$> numP)
, fromNamed (Q.reverse keyNames ^.. Q.itemed)
] <?> "keycode" Does that compile? |
Yes, I probably wasn't very clear, sorry). When I try this keycodeP = choice
[ prefix (char '&') *> ((Keycode . fromIntegral) <$> numP)
, fromNamed (Q.reverse keyNames ^.. Q.itemed)
] <?> "keycode" I get the following output when trying to do
I tried renaming keycodeP = choice
[ prefix (char '&') *> ((keycode . fromIntegral) <$> numP)
, fromNamed (Q.reverse keyNames ^.. Q.itemed)
] <?> "keycode" and I got this:
I'm not sure I can figure out how to fix this in a reasonable time.
If the issue is fixed after the refactoring that would be great! So maybe it's not so important to try to apply the patch, if it's kind of difficult to do it now. Although being able to use raw keycodes would be a big deal also. |
Ooooh, I think I see what's happening. I think you are trying to merge code between to very different versions of KMonad. There was the old way of doing things, then I started trying to implement a new way, and some people switched over (in the
Yeah, I'm not sure it's feasible for me to try and debug your haskell code through github comments. I usually need to compile-fix-compile-fix-compile-fix ad. inf. untill suddenly the type-checker is happy. That loop becomes... difficult like this :)
That's the dream :) |
Okay, it seems that there is no much point in this pull request then, so I'm closing it. |
Notable changes: - Added `around-next-single`, a variant of `around-next` that will release its context on any change, as opposed to only on the release of the 'arounded' button. - Added default compose sequence for Ü - Added a `sticky-key` - Added `--version` (`-V`) flag - Added `+,` for "add a cedilla" - Added `:timeout-button` keyword to `tap-hold-next` and `tap-hold-next-release`, so that they can switch to a button other than the hold button when the timeout expires. - The `multi-tap` key now immediately taps the current key when another key is pressed during tapping. - Fixed compilation error under Mac, having to do with typo in Keycodes. - Fixed issue with empty-names for uinput-sinks. - Ignore SIGCHLD to deal with non-termination bug. --- This should probably be 0.5, but notable issues like [1..6] still preventing me from being comfortable with that. None of these seem completely insurmountable, though, so stay tuned :) [1]: #475 [2]: #704 [3]: #681 [4]: #716 [5]: #516 [6]: #426
Hello,
I have a Varmilo keyboard which has an Fn key.
Every time I press Fn I get the following error:
The same error is described in the issue #72.
I extended the Keycode enumerator up to 464, so it fixes the issue (al least for me).
With this change this key can be mapped in .kbd mappings.
There are two things I'm not sure about though:
@david-janssen mentioned in his comment that covering this 464 value means losing some correspondence. Does it have something to do with compatibility with non-Linux OSes? (I have an Ubuntu system if it's important).
I left some comment there also.
I'm not sure about a correct name for the Fn key, as the enumerator already has the KeyFn item.
I just named it KeyFn2, although it's probably not the best option.