Skip to content

Commit

Permalink
Merge pull request #3758 from pqrs-org/kambala-decapitator-al_music_p…
Browse files Browse the repository at this point in the history
…layer

add Consumer key for music player #2
  • Loading branch information
tekezo authored Mar 24, 2024
2 parents 54c78bd + ca5a0d5 commit fc426ef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/apps/SettingsWindow/Resources/simple_modifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -2483,6 +2483,10 @@
{
"category": "Application Launch keys"
},
{
"label": "al_consumer_control_configuration",
"data": [{ "consumer_key_code": "al_consumer_control_configuration" }]
},
{
"label": "al_word_processor",
"data": [{ "consumer_key_code": "al_word_processor" }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ class fn_function_keys_manipulator_manager final {
{
nlohmann::json data = nlohmann::json::array();

// Typically al_consumer_control_configuration is used as the key to open the music player.
// https://source.android.com/docs/core/interaction/input/keyboard-devices
data.push_back(nlohmann::json::object({
{"from", nlohmann::json::object({{"consumer_key_code", "al_consumer_control_configuration"}})},
{"to", nlohmann::json::object({{"shell_command", "open -a 'Music.app'"}})},
}));

data.push_back(nlohmann::json::object({
{"from", nlohmann::json::object({{"consumer_key_code", "al_word_processor"}})},
{"to", nlohmann::json::object({{"shell_command", "open -a 'Pages.app'"}})},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ constexpr std::pair<const mapbox::eternal::string, const pqrs::hid::usage::value
{"volume_decrement", pqrs::hid::usage::consumer::volume_decrement},

// Application launch buttons
{"al_consumer_control_configuration", pqrs::hid::usage::consumer::al_consumer_control_configuration},
{"al_word_processor", pqrs::hid::usage::consumer::al_word_processor},
{"al_text_editor", pqrs::hid::usage::consumer::al_text_editor},
{"al_spreadsheet", pqrs::hid::usage::consumer::al_spreadsheet},
Expand Down

0 comments on commit fc426ef

Please sign in to comment.