X
XirmiX
Guest
I guess that for solved topics, expecting to get any more advice isn't going to happen:
Well, I guess I'll have to reiterate in a new topic. Essentially, apparently within that topic "keyboard_string = "";" works as a way of preventing a string writing into a text box or whatever else without writing in values that weren't typed in while the box was selected, but while deselected aaand allows for you to safely select and deselect the box without any issue. Well, doesn't work for me...
Essentially I want to make sure that you can write text in the text box while it is selected and not while it's unselected, but I also want to make sure that the text doesn't get erased upon you deselecting it. With the following code:
I get the keyboard_string written in, whether I had or had not selected the text box, after I select the text box, and that is because keyboard_string is always read by the computer... always... but then with this code:
I don't get anything written. Do I need keyboard_string=""; in a different spot? Possibly. Though I still don't see this solving my issue. Take in note that I plan to have multiple of these text box instances on-screen for different things, so I need this to be as applicable to individual instances as possible.
So, how would I get to have:
1) string in textbox only writing when the texbox is selected.
2) nothing typed while the textbox is deselected to be written or deleted from the textbox.
3) have everything within the text box stay as is when you re-select it after having something typed in it the previous time and being able to continue to type from after the last string's position.
Oh, and self.selected is initially set to false in create event, txt is set there as an empty string and max_char is set to 30, so that the user can't type beyond 30 characters.
Well, I guess I'll have to reiterate in a new topic. Essentially, apparently within that topic "keyboard_string = "";" works as a way of preventing a string writing into a text box or whatever else without writing in values that weren't typed in while the box was selected, but while deselected aaand allows for you to safely select and deselect the box without any issue. Well, doesn't work for me...
Essentially I want to make sure that you can write text in the text box while it is selected and not while it's unselected, but I also want to make sure that the text doesn't get erased upon you deselecting it. With the following code:
Code:
if self.selected == true
{
keyboard_check(vk_anykey)
{
if (string_length(keyboard_string) < max_char)
{
txt = keyboard_string;
}
else
{
keyboard_string = txt;
}
}
}
Code:
if self.selected == true
{
keyboard_check(vk_anykey)
{
if (string_length(keyboard_string) < max_char)
{
keyboard_string = "";
txt = keyboard_string;
}
else
{
keyboard_string = txt;
}
}
}
So, how would I get to have:
1) string in textbox only writing when the texbox is selected.
2) nothing typed while the textbox is deselected to be written or deleted from the textbox.
3) have everything within the text box stay as is when you re-select it after having something typed in it the previous time and being able to continue to type from after the last string's position.
Oh, and self.selected is initially set to false in create event, txt is set there as an empty string and max_char is set to 30, so that the user can't type beyond 30 characters.