I can use setText("???") but if I type on my keyboard it doesn't show up, this doesn't work either
public void keyTyped(TextField textField, char key) {
JOptionPane.showMessageDialog(new JFrame(), key);
}
The strange thing is that it doesn't work on mac but it does work on Windows, does anyone have an answer for that?
Thank You!
Here's another question with a similarly topic!
How do you get input from special characters in Libgdx?
I have tried to get the ascii value and puting it through
Gdx.input.isKeyPressed(ascii value);
but it doesn't work. I have set my project encoding to UTF-8 and I can print special characters like ???.
Edit:
I tried this
Gdx.input.setInputProcessor(new InputProcessor() {
@Override
public boolean keyDown(int keycode) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean keyUp(int keycode) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean keyTyped(char character) {
System.out.println(character);
return false;
}
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
return false;
}
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
return false;
}
@Override
public boolean touchDragged(int screenX, int screenY, int pointer) {
return false;
}
@Override
public boolean mouseMoved(int screenX, int screenY) {
return false;
}
@Override
public boolean scrolled(int amount) {
return false;
}
});
Didn't print ???
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…