Skip to content
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

Follow layer mode #612

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open

Conversation

mtoonen
Copy link

@mtoonen mtoonen commented Nov 26, 2023

As mentioned in https://discord.com/channels/895297925578637362/1174360045153177640, a way for bazecor to show the current active layer

…from the keyboard

Signed-off-by: Meine Toonen <toonen.meine@gmail.com>
Signed-off-by: Meine Toonen <toonen.meine@gmail.com>
Signed-off-by: Meine Toonen <toonen.meine@gmail.com>
@mtoonen
Copy link
Author

mtoonen commented Nov 26, 2023

Couple of questions:

  1. const active = await focus.command("layer.isActive"); returns empty. Is this a bug in the firmware?
  2. layer.state gives for a oneshot layer: 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 . This makes it hard to make this work foolproof: you don't know if I went from 1 to 3, or from 3 to 1. See also 1
  3. Made the interval 1000ms. Is this an ok setting?
  4. I had a horrible time debugging: a reload because of a code change resulted in the focusapi losing it's connection, and I had to start the server again. What did I do wrong?

@AlexDygma
Copy link
Member

Couple of questions:

  1. const active = await focus.command("layer.isActive"); returns empty. Is this a bug in the firmware?
  2. layer.state gives for a oneshot layer: 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 . This makes it hard to make this work foolproof: you don't know if I went from 1 to 3, or from 3 to 1. See also 1
  3. Made the interval 1000ms. Is this an ok setting?
  4. I had a horrible time debugging: a reload because of a code change resulted in the focusapi losing it's connection, and I had to start the server again. What did I do wrong?

Hey there!

  1. layer.isActive requires a layer number to test, it will answer true or false depending on its state, so for example layer.isActive 0 -> "true" if you are in layer 0.
  2. the only way to validate that is to compare the current and past states to know what change did you do, we could change the number when you are shifting or one-shotting to layer 3, like using a 2 or whatnot, but that requires FW modifications.
  3. There should not be any issues, but as its integrated, it does not disable when changing views and blocks other data transmissions, so we need to fix that before publishing this feature.
  4. this is a known dev bug due to the serialport library 🤣 , you need to disconnect the keyboard before applying changes. This will be solved when the new comms architecture comes forth with Bz v2.0, which hopefully is very soon 😄

PS. The feature is really cool! 👍

@LuisSevilla
Copy link

Hey @mtoonen!

We've reviewed the feature, and it's interesting, but we want to tweak the UX a bit. We don't want to create two scenarios where people are "locked," either switching layers with the keyboard or the UI. The ideal scenario is that you can do both at the same time.

We'll add it to our feature backlog and hopefully implement it soon.

Thanks for your PR! 💪

@mtoonen
Copy link
Author

mtoonen commented Jan 10, 2024

Hi, sorry for not answering, apparently I turned off notifications 😿 .

If I can do anything to help, please reach out. Will try to enable notifications for this PR.

Thanks for the answers @AlexDygma , glad to see I am not that crazy regarding point 4. Makes sense that serial borks dev experience, had these kinds of problems as well when programming arduino's/esps/etc.

@DabblingLayman
Copy link

any idea when this feature might make it into bazecor? very very interested in this functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants