![]() |
[Announce] [SFOS] Volume/Camera Button Monitor
so many years later, finally implemented a hardware button monitor for sailfish!
functionality is similar to n9-button-monitor. you can use sf-button-monitor to run arbitrary commands while the phone is locked, or unlocked. tested and working on Xperia X and Xperia X Compact, YMMV NOTE: core functionality provided by simply reading from: Code:
/dev/input/by-path/platform-gpio_keys.105-event perl dbus-send (for all CONDITIONS, and for all ACTIONS except cmd(SHELL_CMD)) the following unrelated hacks make this script more useful: -dont unlock the screen when pressing volume/camera -dont control media volume when screen is locked -write window title to a file so window() condition can tell which program is running https://github.com/teleshoes/sf-button-monitor |
Re: [Announce] [SFOS] Volume/Camera Button Monitor
ALSO: this script is only useful if you turn off display-unlock-with-volume/camera with mcetool:
Code:
mcetool --set-exception-length-volume=0 /usr/share/lipstick-jolla-home-qt5/volumecontrol/VolumeControl.qml Code:
*** 473,478 **** |
Re: [Announce] [SFOS] Volume/Camera Button Monitor
I'll be trying that soon on the Proš, it should be very useful, thanks!
Can this be used for events like the following (keyboard open/closed state)? Code:
/dev/input/event2: 1579511420.010 - 0x05/EV_SW - 0x00a/SW_KEYPAD_SLIDE - 0 Code:
/dev/input/event2: 1579511420.010 - 0x05/EV_SW - 0x00a/SW_KEYPAD_SLIDE - 1 |
Re: [Announce] [SFOS] Volume/Camera Button Monitor
Very Cool!
On Proš there are different files. Code:
cat /dev/input/by-path/platform-c17a000.i2c-event-kbd Code:
�&^S For kbd open/close, volume and powerbutton i get same formated values from Code:
cat /dev/input/by-path/platform-soc\:gpio_keys-event Code:
platform-1711a000.sound-tavil-event |
Re: [Announce] [SFOS] Volume/Camera Button Monitor
on x compact, SFOS 3.2.1.20, the key is in the 10th byte and the value (press/release) is in the 12th. (each key press/release produces 16 bytes)
just cat it to a file, press a single key, ctrl+c, and then read the bytes (with hexdump or something). do it 3x with the same key, and 3x with a different key and compare/contrast |
Re: [Announce] [SFOS] Volume/Camera Button Monitor
Will try. Thanks for the explanation!
But i have to correct, your script with adapted path to that of the Proš gives output on exactly one key of the hardware keyboard. It is the w key on QWERTZ / q key on QWERTY that does that if pressed multiple times in a row: Code:
EVENT: CAM_HALF => press 1239ms (ch-press) https://mosushi.de/misc/keyboard-single1.txt Above link is cat > keyboard-single1.txt with only the "1" pressed once. https://mosushi.de/misc/keyboard-3x1.txt This is the cat > keyboard-3x1.txt if i press the "1" key three times followed by "2" key three times. Trying to makes sense of the output, figure to still post it quick since you all are faster. lol. |
Re: [Announce] [SFOS] Volume/Camera Button Monitor
in that case: modify my script, adding this line after line 195:
print "$buttonId ($value)\n"; then run it, press those buttons you want to do, and then add lines around 112 like this: Code:
[qw(16 KEY_W kw)], |
Re: [Announce] [SFOS] Volume/Camera Button Monitor
Perfect, thank you.
Now i understand some more of the script. I can print the assigned value to every key if i add them all in the block around line 115. Specific to Proš: "sym" is code 249. "FX" is code 125. "Yellow Mod" is code 100. I guess the 100 is due to TheKits kernel mod to make it usable in sfos xkbd, right @kabouik? |
Re: [Announce] [SFOS] Volume/Camera Button Monitor
btw, if you get something cool working for you, please pull request your changes. i might not add them to master since i cannot test it in any way (i ONLY have xperias), but others might benefit from it, and i might buy an fxtec soon myself ;)
|
Re: [Announce] [SFOS] Volume/Camera Button Monitor
Quote:
EDIT: Now i have the script altered for gpio read out and found code 10 is the state of the Keyboard. 10 - release is opened 10 - pressed is closed EDIT 2: Now i am able to switch on the keyboard backlight when it opens with this action in sf-button-monitor.conf Code:
action=cmd(echo 1 > /sys/class/leds/keyboard-backlight/brightness),kb,always Code:
[qw(10 KBD_STATE kb)], EDIT 3: I just created a .desktop file in /user/share/applications/ to start the script from app-grid. Works for now :P |
All times are GMT. The time now is 10:44. |
vBulletin® Version 3.8.8