Quantcast
Channel: Support - Pimoroni Buccaneers
Viewing all articles
Browse latest Browse all 6856

Combo button presses for buttonshim

$
0
0

@shoft wrote:

Hi there. I’m making a small walkman of sorts for listening to music while I travel with my partner (the justboom DAC zero has two 3.5mm audio outputs so it can work with two sets of headphones at the same time). The buttonshim is perfect for this too, since it eliminates the need for a screen and is so small. There’s one hitch:

I can’t figure out how to program the buttonshim to handle combination button presses. In other words, it works great for assigning functions to single buttons (i.e. Button A is play/pause, etc). But it would be super useful if I could also assign functions to combinations (i.e. pressing Buttons A and E together turns it off). Is this possible?

I note that the python library says that I can “Attach a press handler to one or more buttons.” but I’m not sure if this means I can assign the same function to more than one button (i.e. Buttons A and B each play/pause music when they’re pressed separately) or if I can attach a unique function to a combination of buttons (i.e. Buttons A and B have their own functions when pressed separately, but when they’re pressed simultaneously they run a third set of commands). I’m a Raspbian newbie, so it’s entirely possible I’m just screwing up something basic like the syntax of a proper “list”.

I’d be grateful for any guidance or clarification.

Cheers!

Tim

Posts: 6

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6856

Trending Articles