Skip to content

Instantly share code, notes, and snippets.

@und3f
und3f / ducky.md
Created January 1, 2025 20:58 — forked from rizalgowandy/ducky.md
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2

To use media keys on the Ducky One 2, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

# Add "get_board_info" helper
$app->helper(
get_board_info => sub {
my $c = shift;
my $data_id = shift;
my @keys = @_;
my $aecv = AE::cv;
my %data;
$aecv->begin (sub { shift->send(\%data) }); # Outer CV
#!/usr/bin/env perl
use strict;
use warnings;
use MojoX::Redis;
my $redis1 = MojoX::Redis->new();
$redis1->sadd("set1" => "foo")->set("foo" => "foo desc")
->sadd("set1" => "bar")->set("bar" => "bar desc")->quit(sub { shift->stop })
#!/usr/bin/env perl
use strict;
use warnings;
use MojoX::Redis 0.8;
my $redis1 = MojoX::Redis->new();
$redis1->sadd("set1" => "foo")->set("foo" => "foo desc")
->sadd("set1" => "bar")->set("bar" => "bar desc")
@und3f
und3f / Author.pm
Created February 25, 2011 21:13 — forked from Meettya/Author.pm
package NoticeBackend::Author;
use Mojo::Base 'Mojolicious::Controller';
use 5.12.0;
use warnings;
use utf8;
use MojoX::Redis;
use Mojo::IOLoop;