You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The keycodes generated by the android keyboard do not match with the constants in PConstants.
I didn't check all but at least the keyCode of backspace is not 8 (as BACKSPACE) but 67.
Activity
benfry commentedon Feb 19, 2013
What is 'key' in those cases? With any luck, it's BACKSPACE.
transfluxus commentedon Feb 26, 2013
the key for BACKSPACE is ï¿¿
import android.view.inputmethod.InputMethodManager;
import android.content.Context;
boolean displayKB=true;
void setup() {
background(0);
showVirtualKeyboard();
fill(255);
textSize(20);
}
void draw() {
}
void mousePressed() {
displayKB = !displayKB;
if (displayKB)
showVirtualKeyboard();
else
hideVirtualKeyboard();
}
void keyPressed() {
background(0);
text(key, 10, 40);
println(key);
if (key == CODED) {
println(keyCode);
if (keyCode == BACKSPACE)
text("BACKSPACE?", 10, 40);
else
if (keyCode == 67)
text("BACKSPACE!", 10, 40);
}
}
void showVirtualKeyboard() {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}
void hideVirtualKeyboard() {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
}
processing-bugs commentedon May 14, 2013
Moved here: processing/processing-android#24
github-actions commentedon Jun 16, 2021
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.