Ricky D Well-Known Member Licensed User Longtime User Aug 30, 2012 #1 I am wondering if it's possible to catch the press of the back key inside a class. What I'd like to do is hide my class if I press the back key when it's showing. So far I can only see that you can do this via the Activity_KeyPress sub on the activity calling the class. regards, Ricky
I am wondering if it's possible to catch the press of the back key inside a class. What I'd like to do is hide my class if I press the back key when it's showing. So far I can only see that you can do this via the Activity_KeyPress sub on the activity calling the class. regards, Ricky
Erel B4X founder Staff member Licensed User Longtime User Aug 30, 2012 #2 This event is only raised in the activity. You can however create a Hide method in your class and call it from Activity_KeyPress (or you can delegate the event to the class). Upvote 0
This event is only raised in the activity. You can however create a Hide method in your class and call it from Activity_KeyPress (or you can delegate the event to the class).
Ricky D Well-Known Member Licensed User Longtime User Aug 30, 2012 #3 How do I delegate the sub to the class? It sounds interesting. I can see how to do it using the Key press event. Regards, Ricky Upvote 0
How do I delegate the sub to the class? It sounds interesting. I can see how to do it using the Key press event. Regards, Ricky
Erel B4X founder Staff member Licensed User Longtime User Aug 30, 2012 #4 You can just create a public KeyPress sub in the class and call it from the Activity_KeyPress sub. Upvote 0
Ricky D Well-Known Member Licensed User Longtime User Aug 30, 2012 #5 Thanks Erel. Because I also use the Activity Key press to capture the Menu key I'll put the code there. Regards, Ricky Upvote 0
Thanks Erel. Because I also use the Activity Key press to capture the Menu key I'll put the code there. Regards, Ricky