- Home /
detect label click or custom keyboard
Hi there
I'm trying to display a custom keyboard on my iphone/android app.
Since I can't use the iphone built-in keyboard, I thought the best way was to display a label like this: GUILayout.Label("my textfield content", "textfield");
So it does look like a textfield but it's actually a label.
The problem now is... how do I display my own keyboard when this label is clicked? Any other better way to achieve this?
Regards, Joaquin
Answer by Rasmus Schlnsen · Sep 27, 2010 at 12:27 AM
You should look into GUILayoutUtility.GetLastRect() function for getting the rect of the label.
E.g
GUILayout.Label("my textfield content", "textfield");
if (GUILayoutUtility.GetLastRect().Contains(Event.current.mouseposition) && Input.GetMouseButtonDown(0))
{
// Do label click action here
}
Answer by Ashkan_gc · Apr 16, 2011 at 05:04 AM
Rasmus's answer is correct and in that way you could check for a click on a label but why don't you use a button that is styled like a label. just set it's style in your skin in the way you want. even you can create a custom style and use it only for those label like buttons.
Answer by Mantas-Puida · Sep 27, 2010 at 12:25 PM
you probably would like check following forum posts with custom on-screen keyboard for iphone :
Your answer

Follow this Question
Related Questions
How do you bring up the mobile keyboard without this area? 1 Answer
If, GetKeyDown, and Update() not working 2 Answers
Changing the keyboard type used on a GUI.TextField 0 Answers
iphone keyboard string length 1 Answer
Camera view changes when opening iPhoneKeyboard. How to make it not change? 0 Answers