Arkadii Ivanov
4 years ago
2 changed files with 22 additions and 1 deletions
@ -0,0 +1,16 @@
|
||||
package example.todo.common.utils |
||||
|
||||
import androidx.compose.ui.input.key.ExperimentalKeyInput |
||||
import androidx.compose.ui.input.key.Key |
||||
import androidx.compose.ui.input.key.KeyEvent |
||||
|
||||
@OptIn(ExperimentalKeyInput::class) |
||||
fun onKeyUp(key: Key, onEvent: () -> Unit): (KeyEvent) -> Boolean = |
||||
{ keyEvent -> |
||||
if (keyEvent.key == key) { |
||||
onEvent() |
||||
true |
||||
} else { |
||||
false |
||||
} |
||||
} |
Loading…
Reference in new issue