Typing characters with accent marks in a textbox #38

This commit is contained in:
João Lopes 2019-01-25 17:28:25 +00:00
parent d3dad67633
commit e4d5e0160a
2 changed files with 26 additions and 8 deletions

View File

@ -463,6 +463,13 @@ public final class ControlWindow {
return;
}
if ( theKeyEvent.getAction( ) == KeyEvent.TYPE ) {
keys[ theKeyEvent.getKeyCode( ) ] = true;
numOfActiveKeys++;
cp5.modifiers = theKeyEvent.getModifiers( );
key = theKeyEvent.getKey( );
}
if ( theKeyEvent.getAction( ) == KeyEvent.PRESS ) {
keys[ theKeyEvent.getKeyCode( ) ] = true;
numOfActiveKeys++;
@ -475,6 +482,7 @@ public final class ControlWindow {
keys[ theKeyEvent.getKeyCode( ) ] = false;
numOfActiveKeys--;
cp5.modifiers = theKeyEvent.getModifiers( );
keyCode = theKeyEvent.getKeyCode( );
}
if ( theKeyEvent.getAction( ) == KeyEvent.PRESS && cp5.isShortcuts( ) ) {

View File

@ -357,15 +357,25 @@ public class Textfield extends Controller< Textfield > {
}
public void keyEvent( KeyEvent theKeyEvent ) {
if ( isUserInteraction && isTexfieldActive && isActive && theKeyEvent.getAction( ) == KeyEvent.PRESS ) {
if ( ignorelist.contains( cp5.getKeyCode( ) ) ) {
return;
}
if ( keyMapping.containsKey( cp5.getKeyCode( ) ) ) {
keyMapping.get( cp5.getKeyCode( ) ).execute( );
} else {
if ( isUserInteraction && isTexfieldActive && isActive) {
if(theKeyEvent.getAction( ) == KeyEvent.TYPE) {
if ( ignorelist.contains( cp5.getKeyCode( ) ) ) {
return;
}
if ( keyMapping.containsKey( cp5.getKeyCode( ) ) ) {
return;
}
keyMapping.get( DEFAULT ).execute( );
}
if( theKeyEvent.getAction( ) == KeyEvent.PRESS ) {
if ( ignorelist.contains( cp5.getKeyCode( ) ) ) {
return;
}
if ( keyMapping.containsKey( cp5.getKeyCode( ) ) ) {
keyMapping.get( cp5.getKeyCode( ) ).execute( );
}
}
}
}