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

[Feature] Add block for read_input_byte #1574

Closed
laurensvalk opened this issue Mar 29, 2024 · 2 comments
Closed

[Feature] Add block for read_input_byte #1574

laurensvalk opened this issue Mar 29, 2024 · 2 comments
Labels
enhancement New feature or request software: pybricks-blocks Issues with blocks and code generation software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: remote control Issues related to remotly controlling hubs

Comments

@laurensvalk
Copy link
Member

Is your feature request related to a problem? Please describe.
Keyboard input is a fairly common use case.

Describe the solution you'd like
Somehow provide keyboard input. A block to match read_input_byte might be good for that.

It could be used as is, or perhaps with a small wrapper to convert to a character if within valid range.

@laurensvalk laurensvalk added enhancement New feature or request topic: remote control Issues related to remotly controlling hubs software: pybricks-blocks Issues with blocks and code generation labels Mar 29, 2024
@laurensvalk
Copy link
Member Author

Not just for blocks, but also for Python this function could potentially be a bit more multi-purpose with two additional parameters:

  • chr=False: Whether to apply the chr() function to the resulting byte.
  • last=False: Whether to discard everything but the last value.

Use case: keyboard remote control where you just care about the last press and with a helpful translation to the key if it exists.

@laurensvalk
Copy link
Member Author

Now released in latest beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request software: pybricks-blocks Issues with blocks and code generation software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: remote control Issues related to remotly controlling hubs
Projects
None yet
Development

No branches or pull requests

1 participant