fix toot sending twice when using a hardware keyboard (#1758)
This commit is contained in:
parent
3c3e872782
commit
f3d05f82f9
|
@ -907,6 +907,7 @@ class ComposeActivity : BaseActivity(),
|
||||||
|
|
||||||
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
||||||
Log.d(TAG, event.toString())
|
Log.d(TAG, event.toString())
|
||||||
|
if(event.action == KeyEvent.ACTION_DOWN) {
|
||||||
if (event.isCtrlPressed) {
|
if (event.isCtrlPressed) {
|
||||||
if (keyCode == KeyEvent.KEYCODE_ENTER) {
|
if (keyCode == KeyEvent.KEYCODE_ENTER) {
|
||||||
// send toot by pressing CTRL + ENTER
|
// send toot by pressing CTRL + ENTER
|
||||||
|
@ -919,7 +920,7 @@ class ComposeActivity : BaseActivity(),
|
||||||
onBackPressed()
|
onBackPressed()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return super.onKeyDown(keyCode, event)
|
return super.onKeyDown(keyCode, event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue