-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
494 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: Media Keys / Consumer Controls | ||
description: How to enable media keys for your keyboard layout. | ||
--- | ||
|
||
`rumcake` can be configured to send HID reports that consist of [variants in the USB consumer usage page](https://docs.rs/usbd-human-interface-device/latest/usbd_human_interface_device/page/enum.Consumer.html). | ||
This includes media controls, application launchers, application controls, etc. | ||
|
||
# Setup | ||
|
||
## Required Cargo features | ||
|
||
You must enable the following `rumcake` features: | ||
|
||
- `media-keycodes` | ||
|
||
## Required code | ||
|
||
After enabling the `media-keycodes` feature, you can start using the `Keycode::Media` variants in your `KeyboardLayout` implementation: | ||
The `Keycode::Media` variant must contain a `usbd_human_interface_device::page::Consumer` variant, which is re-exported as `rumcake::keyboard::Consumer`. | ||
|
||
Example of usage: | ||
|
||
```rust ins={2} ins="{Custom(Media(VolumeIncrement))}" | ||
use keyberon::action::Action::*; | ||
use rumcake::keyboard::{Consumer::*, Keycode::Media}; | ||
|
||
/* ... */ | ||
|
||
build_layout! { | ||
{ | ||
[ Escape {Custom(Media(VolumeIncrement))} A B C] | ||
} | ||
} | ||
``` |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,5 @@ stm32 = [] | |
nrf = [] | ||
|
||
storage = [] | ||
|
||
media-keycodes = [] |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.