Pfap
Member
I have been playing around with the new virtual keyboard functions with ios and have noticed a few issues.
I have an object that brings up the keyboard in the first room of my tests. It wasn't bringing the keyboard up, but there was some strange flicker in the default Gms2 splash screen, so I put an alarm in the objects create event and had the alarm bring the keyboard up and that worked fine.
The main reason I made this post and I hope somebody has a solution is that the keyboard events don't seem to work with the virtual keyboard. I am specifically trying to check for when the user presses the return key and have tried the following.
I checked the manual and I am not using predictive text.
I tried checking keyboard_key to find the keycode and the built in variable keyboard_key does not work on ios.
I figured the return code would be 13 and a quick web search does confirm this. The key press enter event does not work either. I also tried with the step event.
Any ideas?
I have an object that brings up the keyboard in the first room of my tests. It wasn't bringing the keyboard up, but there was some strange flicker in the default Gms2 splash screen, so I put an alarm in the objects create event and had the alarm bring the keyboard up and that worked fine.
The main reason I made this post and I hope somebody has a solution is that the keyboard events don't seem to work with the virtual keyboard. I am specifically trying to check for when the user presses the return key and have tried the following.
I checked the manual and I am not using predictive text.
The last argument is to enable/disable predictive text, and this would be set to true to permit it, and false otherwise, but note that just because it is permitted doesn't mean that it will be used as that will depend on the preferences of the user on the device. When in predictive text mode, the virtual keyboard will not generate normal GameMaker Studio 2 keypress events. Instead, it will only update the last character pressed and keyboard string variables. This is due to the inability to detect whether a change in the internal text field used for detecting key presses came from an actual virtual keyboard key, or a text suggestion. In these cases you would want to read the keyboard_string input as opposed to reading any kind of raw key input.
I tried checking keyboard_key to find the keycode and the built in variable keyboard_key does not work on ios.
I figured the return code would be 13 and a quick web search does confirm this. The key press enter event does not work either. I also tried with the step event.
Code:
current_key = keyboard_key;
//13 should be the return key and if the string is empty don't do anything
if current_key == 13 && my_string != "" && click_once == true{
show_debug_message("The return key has been pressed");
click_once = false;
}
Any ideas?