Trigger: Physical keyboard opened/closed

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
User avatar
mbirth
Posts: 80
Joined: 17 Mar 2016 00:02
Location: Berlin, Germany
Contact:

Trigger: Physical keyboard opened/closed

Post by mbirth » 17 Mar 2016 23:17

I just wanted to move a simple task from Tasker to Automagic:

Trigger: Physical keyboard has been closed
Task: Show a toast message (more actions later)

But there seems to be no condition for the physical keyboard (e.g. on a Blackberry PRIV). Could this be added, please?
Last edited by mbirth on 23 Mar 2016 10:26, edited 2 times in total.
BlackBerry KEY2, Android 8.1.0

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Condition: Physical keyboard opened/closed

Post by MURTUMA » 18 Mar 2016 19:24

If your phone is rooted, you could check from the logs if there's relevant event.

User avatar
mbirth
Posts: 80
Joined: 17 Mar 2016 00:02
Location: Berlin, Germany
Contact:

Re: Trigger: Physical keyboard opened/closed

Post by mbirth » 20 Mar 2016 00:11

The BlackBerry can't be rooted. Tasker and Automate have a native trigger for that, so there seems to be some way to catch that.

EDIT: Here's a page from BlackBerry about how to detect physical keyboard in Android: http://devblog.blackberry.com/2015/11/r ... rd-part-1/
BlackBerry KEY2, Android 8.1.0

User avatar
mbirth
Posts: 80
Joined: 17 Mar 2016 00:02
Location: Berlin, Germany
Contact:

Re: Trigger: Physical keyboard opened/closed

Post by mbirth » 28 Sep 2016 12:41

Any progress here?

The Android way is described here and uses onConfigurationChanged and the Configuration object. It doesn't look that complicated.
BlackBerry KEY2, Android 8.1.0

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Trigger: Physical keyboard opened/closed

Post by Martin » 28 Sep 2016 19:31

Thanks for the links! This should be quite straight forward to add. I'll add it to the todo-list.
Would be great if you could test if it's working properly on your device once it's implemented since I don't have any device with a hardware keyboard anymore.

Regards,
Martin

User avatar
mbirth
Posts: 80
Joined: 17 Mar 2016 00:02
Location: Berlin, Germany
Contact:

Re: Trigger: Physical keyboard opened/closed

Post by mbirth » 28 Sep 2016 19:36

Martin wrote:Would be great if you could test if it's working properly on your device once it's implemented since I don't have any device with a hardware keyboard anymore.
Of course! :) Thank you!
BlackBerry KEY2, Android 8.1.0

User avatar
mbirth
Posts: 80
Joined: 17 Mar 2016 00:02
Location: Berlin, Germany
Contact:

Re: Trigger: Physical keyboard opened/closed

Post by mbirth » 07 Nov 2016 21:51

Tested it in the current EAP version and it seems to work fine on my BlackBerry PRIV.

One suggestion: You could supply the keyboard_type variable in the opened/closed condition already so I don't have to figure it out using the condition later. Maybe even make opened/closed checkboxes (in the trigger) and set a variable keyboard_state to "open" or "closed" depending on the state (or let the script figure it out with the state condition).
BlackBerry KEY2, Android 8.1.0

Locked