SDL: option for desktop mouse mode / no touch filtering, added back backspace key handler hack to text input window

This commit is contained in:
Sergii Pylypenko
2017-01-27 22:24:08 +02:00
parent 1b8e4d3414
commit fc3265c289
8 changed files with 30 additions and 11 deletions

View File

@@ -820,7 +820,6 @@ public class MainActivity extends Activity
_parent.hideScreenKeyboard();
return true;
}
/*
if (keyCode == KeyEvent.KEYCODE_DEL || keyCode == KeyEvent.KEYCODE_CLEAR)
{
// EditText deletes two characters at a time, here's a hacky fix
@@ -830,12 +829,12 @@ public class MainActivity extends Activity
int start = t.getSelectionStart(); //get cursor starting position
int end = t.getSelectionEnd(); //get cursor ending position
if ( start < 0 )
return true;
return false;
if ( end < 0 || end == start )
{
start --;
if ( start < 0 )
return true;
return false;
end = start + 1;
}
t.setText(t.getText().toString().substring(0, start) + t.getText().toString().substring(end));
@@ -843,7 +842,6 @@ public class MainActivity extends Activity
return true;
}
}
*/
//Log.i("SDL", "Key " + keyCode + " flags " + event.getFlags() + " action " + event.getAction());
return false;
}