<commit_before>package io.clappr.player.extensions

import android.os.Bundle
import io.clappr.player.base.EventData
import io.clappr.player.base.keys.Action
import io.clappr.player.base.keys.Key

data class InputKey(val key: Key, val action: Action)

fun Bundle.extractInputKey(): InputKey? {
    val keyCode = getString(EventData.INPUT_KEY_CODE.value).orEmpty()
    val keyAction = getString(EventData.INPUT_KEY_ACTION.value).orEmpty()

    val key = Key.getByValue(keyCode)
    val action = Action.getByValue(keyAction)

    return when {
        key != null && action != null -> InputKey(key, action)
        else -> null<commit_msg>feat(bundle_extension): get is long press inside extract input key extension<commit_after>package io.clappr.player.extensions

import android.os.Bundle
import io.clappr.player.base.EventData
import io.clappr.player.base.keys.Action
import io.clappr.player.base.keys.Key

data class InputKey(val key: Key, val action: Action, val isLongPress: Boolean)

fun Bundle.extractInputKey(): InputKey? {
    val keyCode = getString(EventData.INPUT_KEY_CODE.value).orEmpty()
    val keyAction = getString(EventData.INPUT_KEY_ACTION.value).orEmpty()
    val isLongPress = getBoolean(EventData.INPUT_KEY_IS_LONG_PRESS.value, false)

    val key = Key.getByValue(keyCode)
    val action = Action.getByValue(keyAction)

    return when {
        key != null && action != null -> InputKey(key, action, isLongPress)
        else -> null
{'fraction_non_alphanumeric': 0.10584192439862543, 'fraction_numerical': 0.0, 'mean_word_length': 4.333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5712846', 'n_tokens_mistral': 461, 'n_tokens_neox': 454, 'n_words': 102}