launchy icon indicating copy to clipboard operation
launchy copied to clipboard

add very very basic support for launchpad1

Open timglabisch opened this issue 4 years ago • 1 comments
trafficstars

i have a launchpad1 and wanted to create a simple program for my 1 year old daughter. Just a few buttons that are clickable. using trial and error i managed to do basic stuff like clear, button_set, ....

the code is not mergeable and contains a lot of stuff from the mk2 (didn't try the canvas api, the color palette is wrong and so on ....) but may it's interesting for someone who also want to add support for launchpad1.

i also doesn't found any good docs about the launchpad1 - if someone knows where to find them, pls let me know. :)

example code that works:

let input = launchy::launchpad_orig::Input::guess_polling()?;
let mut output = launchy::launchpad_orig::Output::guess()?;

output.clear()?;
for msg in input.iter() {
    match msg {
        Message::Press {button} => {
            output.set_button(button, PaletteColor::new(3), LightMode::Flash)?;
        },
        Message::Release {button} => {
            output.set_button(button, PaletteColor::new(48), LightMode::Flash)?;
        },
        _ => {}
    }
    println!("data {:?}", msg);
}

timglabisch avatar Oct 06 '21 21:10 timglabisch

Thanks for the PR! I will not merge the PR, but probably keep it open for others to see...

By the way, a better base to build upon would probably be the Launchpad S (instead of MK2). The S is both chronologically and API-wise very near to the original Launchpad.

kangalio avatar Oct 07 '21 13:10 kangalio