We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Good afternoon,
I'm designing an android app and do not know how I can use the virtual keyboard.
Is there a way to call android keyboard while the application is running? or Should I create a keyboard on my own?
Thanks in advance
Anthony20
Answers
Processing doesn't behave like a native text-editable view, so Android won't show the keyboard unless it is specifically asked to. You can force the keyboard to show and hide, but you'll still have to handle key presses yourself (in the same way as Java mode):
Thanks so much, Calsing:
is also necessary to import (import android.content.Context;)
Thank you very much for helping to solve my problem.
Anthony20
How the keyboard view toggles if I use only hideVirtualKeyboard()? firstrun, keyboard comes up, next run keyboard hides and so on
You you should be able to control this with a variable locking and a conditional with mousePressed
This idea with a variable doesn't work if the keyboard is hide with the device back button or is shown by selecting a edit text field.
The base problem is that the function hideVirtualKeyboard is also show the keyboard if it was hidden. If this function ONLY hides the keyboard then there where no problem.
Is there a way to get the status of the soft keyboard? If it is visible or hidden? This can solve the problem.
I also want to know that :D
At this time I have not found a solution.
@klsc Hi, I found an effective way to close the keyboard, I think that can help you: imm.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
Regards
Anthony20
Thank you anthony, I will test it in future. At this time I don't work on this project. but I will remind me if I need it.
at this time I have problems with starting processing 3.0 :(
i am getting an error while running this code on my Samsung galaxy s5 neo, the bootloader says "the function getsystem(string) does not exist, how do I solve this?
Can you post what code you are referring to? Please also add what Procession version and OS that you are suing.
Kf
@electrosquid===
i think that this code is for P2, not for P3.
@electrosquid
Here's some new code for Android Mode 3.0 based on Ketai's keyboard implementation:
@calsign===
it seems to me that this code is what ketai is wrapping(knowing that we are in fragment)... if you are using ketai you write only: