Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG] EditBox displays a box character when the cursor keys are pressed

Author
Message
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 5th Oct 2017 21:31
When you press the cursor keys in an editbox to move the blinking cursor it types a square ascii character in the editbox instead of moving the cursor.

This is a fix but it would be good to have it fixed in AGK



This problem occurs on a Mac. Don't know what it's like on a PC.
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 6th Oct 2017 20:03
To save starting a new thread, does anyone know how to get a button next to an editbox do something when pressed without having to press the button twice please?

On a Mac it works on the first press but on my Samsung the first press of the button is treated as leaving the edit box which makes the keyboard disappear and then I have to press the button a second time to do something.

I can't seem to work out how to have the keyboard close automatically and then continue activating the button. I've tried setting focus to 0 and active to 0 when pressing the button but that doesn't work. I've also tried adding those two focus and active functions in the GetPointerPressed part and then my button code in the GetPointerReleased block but that doesn't work either.

Here's the simplest version of the code without all of my attempts at getting it to work.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 6th Oct 2017 20:43 Edited at: 6th Oct 2017 20:48
Quote: "get a button next to an editbox"

maybe add this usage and simulate click? (me not know the meaning of this button.)


or set focus once and wait lost focus?

AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.9.3) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 6th Oct 2017 21:05 Edited at: 6th Oct 2017 21:09
I say button but it's really just a sprite. Think of it like a submit button next to a text box. When you press the button it should do it's action, but on a mobile device (well only tested on an Android) pressing the button/sprite isn't actually pressing it because the first thing that happens is the edit box loses focus making the on screen keyboard disappear. End fo action. What I want is the keyboard to disappear and then let the button do it's action but it takes two presses before that happens.

I don't want the submit action to happen when they leave the edit box unless they've pressed the submit button. I'm still playing around trying different things

I did try this

Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 6th Oct 2017 21:54 Edited at: 6th Oct 2017 21:58
I've got it working how I want it to work but it's confusing as hell!

Let me explain what I'm really after. To start with I want the text box disabled. I then want the user to press a button next to it to edit what's in the text box. This is for a username. When they press the button the textbox is active and they can start typing. Once they've finished they press the button again to save and then it's finished. Each press of the button will change the button label, from "Edit" to "Save" and then eventually "Taken" if the username is already taken. This isn't a normal register form. Each user gets assigned a username when they update/install the app, and if they choose to they can change it.



For now the problem is solved it's doing what I want. But most scenarios wouldn't want the textbox deactivated first. A normal scenario would be to click in the textbox, type something and then press the submit button. That works on a normal computer but on a device when you click anywhere outside of the textbox even if you press on a sprite, GetPointerPressed doesn't register. I knew there was a reason why I try to avoid using edit boxes in AppGameKit
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 6th Oct 2017 22:12 Edited at: 6th Oct 2017 22:14
Quote: "I did try this"

i tryed something else but got no solution

AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.9.3) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 6th Oct 2017 22:12 Edited at: 6th Oct 2017 22:15
This example shows that GetPointerPressed() doesn't register when you click outside of a edit box on a mobile device because the keyboard disappearing stops it.



I would class this as a bug too. Is there a proper channel to register bugs? Or is it via the forum?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 6th Oct 2017 22:14
how about hide the button if the edit box have focus, the user will not click it
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.9.3) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 6th Oct 2017 22:18
Markus, that would probably work. They would have to click out of the edit box and then the button will appear but that's not very intuitive (that the word?).

Thanks for all of your help again! It's definitely a bug with GetPointerPressed not registering when clicking outside of an editbox on a mobile device.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 7th Oct 2017 09:29
yes, sure its a workaround.
lets wait what paul say to this two problems.
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.9.3) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Oct 2017 14:28
Quote: "When you press the cursor keys in an editbox to move the blinking cursor it types a square ascii character in the editbox instead of moving the cursor"

Doesn't happen on Windows but managed to replicate it on Mac. Fixed for the next version.

Quote: "GetPointerPressed not registering when clicking outside of an editbox on a mobile device."

Thanks, fixed for the next version.
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 16th Oct 2017 10:06
Awesome! Thank you Paul

Login to post a reply

Server time is: 2024-04-20 09:36:17
Your offset time is: 2024-04-20 09:36:17