maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   usage of headset button (https://talk.maemo.org/showthread.php?t=96234)

pmrb 2015-12-07 14:34

usage of headset button
 
Hi,

Would it be possible to use the button of the headset for several applications, and if yes, how please?

For example like this:
When button is pressed:
- if there is an incoming call, accept it
- else if music is playing (with QuasarMXPro), skip to next song
- else if Recorder application is open, start recording from microphone

TIA for any hints, Peter

pichlo 2015-12-07 15:18

Re: usage of headset button
 
So what if you have music playing AND you receive a call? ;)

(Sorry, I haven't got a clue about the actual solution. Just throwing in some food for thought.)

nieldk 2015-12-07 15:57

Re: usage of headset button
 
Quote:

Originally Posted by pichlo (Post 1490778)
So what if you have music playing AND you receive a call? ;)

(Sorry, I haven't got a clue about the actual solution. Just throwing in some food for thought.)

Then ny choise would be an option to accept call.

kazzie 2015-12-07 17:03

Re: usage of headset button
 
I just plugged in a headset and pressed its call button, while monitoring xev for output. It's picked up as the special XF86Phone button, much like the volume buttons (on phone and headset) are XF86AudioRaiseVolume and XF86AudioLowerVolume. Here's the result of a press & release:

Code:

KeyPress event, serial 30, synthetic NO, window 0x3a00001,
    root 0x4d, subw 0x0, time 694375665, (384,111), root:(386,149),
    state 0x0, keycode 177 (keysym 0x1008ff6e, XF86Phone), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 30, synthetic NO, window 0x3a00001,
    root 0x4d, subw 0x0, time 694375797, (384,111), root:(386,149),
    state 0x0, keycode 177 (keysym 0x1008ff6e, XF86Phone), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

This may be a helpful place to start if you come to writing some code.

Roth 2015-12-12 10:49

Interesting. I know there different headsets out there; one with 1 button, one with 2 buttons, one with 3 buttons, and of course ones with no buttons. I can see doing a double-press to change music track and stuff. It would be neat if we could manually customize the action(s) ourself.


All times are GMT. The time now is 10:44.

vBulletin® Version 3.8.8