moster67 Expert Licensed User Longtime User Jun 10, 2014 #1 I am well aware that keyevents cannot be tracked from a service due to security reasons. At least this is true what regards the edit-text and soft keyboard I think. However, I have read that some hardware buttons such as Volume can be detected from a service. I am in the need to detect the keyevent and the keycode from a TV Remote Control in a service. Using Activity_KeyPress (in an activity of course) I have managed to get most keycodes necessary. I am not sure but perhaps d-pad constants and other hardware-buttons can also work with a service? At least I would like to try and thus I am wondering what code I would need to write to get the keyevent in a service? Any help would be appreciated. Edit: perhaps the BroadcastReceiver-library can be used for this purpose? Last edited: Jun 10, 2014
I am well aware that keyevents cannot be tracked from a service due to security reasons. At least this is true what regards the edit-text and soft keyboard I think. However, I have read that some hardware buttons such as Volume can be detected from a service. I am in the need to detect the keyevent and the keycode from a TV Remote Control in a service. Using Activity_KeyPress (in an activity of course) I have managed to get most keycodes necessary. I am not sure but perhaps d-pad constants and other hardware-buttons can also work with a service? At least I would like to try and thus I am wondering what code I would need to write to get the keyevent in a service? Any help would be appreciated. Edit: perhaps the BroadcastReceiver-library can be used for this purpose?
Erel B4X founder Staff member Licensed User Longtime User Jun 11, 2014 #2 See this link: http://www.b4x.com/android/forum/threads/intercept-volume-button-press.28179/#post-163378 Upvote 0
See this link: http://www.b4x.com/android/forum/threads/intercept-volume-button-press.28179/#post-163378