wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 27 Feb 2014 06:08 PM |
| Is there a way to be able to detect KeyDown while the player is focused on a textbox? |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
| |
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 27 Feb 2014 06:12 PM |
| KeyDown events dont occur while the player is focused (typing/ active cursor) in a gui textbox. |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2014 06:12 PM |
| Why would you even need this. |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 27 Feb 2014 06:13 PM |
| Thats not relevant, but a visual SB. |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2014 06:14 PM |
I'm guessing you're making an 'Editable' textbox? How about instead of using default edit option you make it psuedo-editable? A normal text label, when you click it the background color changes to indicate you are editing. Then you detect all keydown strokes and adjust the text yourself (you could even have your own blinking cursor). Not sure exactly how you will end editing, maybe when they click anywhere that isn't the text box, or click esc, etc..? |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 27 Feb 2014 06:14 PM |
| I could see what textbos the player is focused on and save the text every time they press a key but that will not work for enter and backspace. |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 27 Feb 2014 06:14 PM |
| It's not going to detect if you are writing something but it will detect if you enter it.. asdf |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2014 06:14 PM |
And this is because how annoying would it be if the button 'e' creates a nuke, and you were typing in a word in textbox like "I like pie"
2 nukes go off right there. |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 27 Feb 2014 06:15 PM |
| Thats smart, but it would be extremely difficult to place the cursor at the right position in the text based on where the player clicks. |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 27 Feb 2014 06:16 PM |
| I can make an if statement to make sure the function I want only happens when a player is in a box, a nuke wont be a problem. |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2014 06:20 PM |
| Hadn't thought about arbitrary cursor placement in the line of text. Without pixel spacing information on the text, I don't see anything other than an unreliable 'guessing' method using the x/y position and number of characters. Maybe you'll just have to sacrifice cursor placement and give them better ways to navigate the text to begin editing? (Give them buttons to hop down/up a line or right/left a word) |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 27 Feb 2014 06:25 PM |
| Thank you, everyone, for the ideas. |
|
|
| Report Abuse |
|
|