Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
def4926
bump version to 4.6.3
sds100 Oct 23, 2026
0b74c35
ask to upload play store assets in Fastfile
sds100 Oct 23, 2026
4fca5f5
refactor TriggerSetupBottomSheet to be extensible
sds100 Oct 24, 2026
0e4cbd2
refactor TriggerSetupBottomSheet to be extensible
sds100 Oct 24, 2026
d9aa216
fix TriggerSetupBottomSheet to be completely scrollable and not go un…
sds100 Oct 24, 2026
c42bc11
dismiss whats new dialog immediately without waiting for preference t…
sds100 Oct 24, 2026
86e3b81
add category to PackageInfo
sds100 Oct 24, 2026
d84ee6e
set version to 4.7.0
sds100 Oct 25, 2026
c9b09a8
refactor: only use bundle paywall. The legacy one is removed.
sds100 Oct 26, 2026
87556d7
bump version code
sds100 Oct 26, 2026
1cbfcc8
refactor TriggerDiscoverScreen to show gaming mode shortcuts
sds100 Oct 26, 2026
38bf837
Update README.md
sds100 Oct 31, 2026
868a85c
Merge remote-tracking branch 'origin/develop' into develop
sds100 Nov 2, 2026
abb5c37
refactor TriggerSetupBottomSheet
sds100 Nov 2, 2026
2c8b829
implement shared text fixtures gradle module
sds100 Nov 2, 2026
31cab0c
#2183 fix: Volume key no longer acts as the power button after single…
sds100 Nov 2, 2026
6a9ddd2
#2304 fix: Expert Mode fails to start on Honor Android 17
sds100 Nov 2, 2026
65c398a
hoist tip content
sds100 Nov 2, 2026
7acaf75
#2305 Expert Mode auto starts with Shizuku if Shizuku starts after Ke…
sds100 Nov 5, 2026
b794152
#2305 fix: Expert Mode restarts if it is killed shortly after auto st…
sds100 Nov 5, 2026
8109150
#2310 feat: sort key maps by name. Unnamed key maps are last.
sds100 Nov 5, 2026
41fecc0
#2311 feat: sort triggers, actions and constraints alphabetically by …
sds100 Nov 5, 2026
506f36a
update changelog
sds100 Nov 6, 2026
ed8c179
#2279 feat: broadcast whether mappings are paused so other apps can r…
sds100 Nov 6, 2026
e900f1d
#2318 fix: text action works on Android 12 an older in Termux and som…
sds100 Nov 6, 2026
3a61f53
#2278 feat: do not disturb constraint
sds100 Nov 6, 2026
f56c74a
Merge branch 'feature/2279-mappings-state-broadcast' into develop
sds100 Nov 7, 2026
65ec1ae
#2308 fix: cycle keyboard language action changes the physical keyboa…
sds100 Nov 7, 2026
16b6935
Merge branch 'feature/2278-dnd-constraint' into develop
sds100 Nov 7, 2026
4e6881f
fix: empty key map list is scrollable
sds100 Nov 8, 2026
9981cfe
set changelog release date
sds100 Nov 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## [4.7.0](https://github.com/sds100/KeyMapper/releases/tag/v4.7.0)

#### 08 November 2026

## Added

- #2310 Sort key maps by name. Unnamed key maps are last.
- #2279 Broadcast whether mappings are paused so other apps can respond to it.
- #2278 Do Not Disturb constraint.

## Changed

- Only use one bundle paywall. The legacy one is removed.
- #2311 Sort triggers, actions and constraints alphabetically by the text shown in the key map list.

## Fixed

- #2183 Volume key no longer acts as the power button after single pressing a power button double press trigger in Expert Mode.
- #2304 Expert Mode fails to start on Honor Android 17.
- #2305 Expert Mode restarts if it is killed shortly after auto starting, and auto starts with Shizuku if Shizuku starts after Key Mapper.
- #2315 Floating buttons no longer use an out of date display size, which could shift them and trap them in part of the screen while dragging.
- #2318 Text action works on Android 12 an older in Termux and some other apps.
- #2308 Cycle keyboard language action changes the physical keyboard language when using the Key Mapper keyboard on Android 14+.

## [4.6.2](https://github.com/sds100/KeyMapper/releases/tag/v4.6.2)

#### 22 October 2026
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
<a href='https://play.google.com/store/apps/details?id=io.github.sds100.keymapper&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' height='75px'/></a>
<a href="https://f-droid.org/packages/io.github.sds100.keymapper/" rel="nofollow"><img alt="Get it on F-Droid" height="75" src="https://user-images.githubusercontent.com/53379023/142497343-0e635fc5-056b-46ff-8d8e-d607ed95527e.png" data-canonical-src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" style="max-width: 100%;"></a>
</br>
<a href='https://ko-fi.com/M4M41032E' target='_blank'><img height='30' style='border:0px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=2' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
<noscript><a href="https://liberapay.com/sds100/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></noscript>
<noscript><a href="https://buy.stripe.com/00g16L9YEabldDWdQQ"><img alt="Donate using Stripe" src="https://img.shields.io/badge/Donate-Stripe-blueviolet?style=for-the-badge&logo=stripe"></a></noscript>
<a href='https://ko-fi.com/M4M41032E' target='_blank'><img height='50' style='border:0px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=2' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
</p>

## Unleash your keys!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ class PurchasingManagerImpl : PurchasingManager {
override val state: Flow<State<KMResult<RevenueCatState>>> =
MutableStateFlow(State.Data(PurchasingError.PurchasingNotImplemented))

override suspend fun launchPurchasingFlow(
packageId: String,
verifyEntitlements: Array<RevenueCatEntitlementId>,
): KMResult<Unit> {
return PurchasingError.PurchasingNotImplemented
}

override suspend fun isPackagePurchased(packageId: String): KMResult<Boolean> {
override suspend fun launchPurchasingFlow(packageId: String): KMResult<Unit> {
return PurchasingError.PurchasingNotImplemented
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class ConfigTriggerViewModel @Inject constructor(
override fun showTriggerSetup(shortcut: TriggerSetupShortcut, forceExpertMode: Boolean) {
when (shortcut) {
TriggerSetupShortcut.ASSISTANT,
TriggerSetupShortcut.FLOATING_BUTTON_CUSTOM,
TriggerSetupShortcut.FLOATING_BUTTON_LOCK_SCREEN,
-> viewModelScope.launch {
navigateToAdvancedTriggers("purchase_assistant_trigger")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,59 @@
package io.github.sds100.keymapper.trigger

import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import io.github.sds100.keymapper.base.trigger.BaseTriggerScreen
import io.github.sds100.keymapper.base.trigger.HandleTriggerSetupBottomSheet
import io.github.sds100.keymapper.base.trigger.TriggerDiscoverBottomSheet
import io.github.sds100.keymapper.base.trigger.TriggerDiscoverScreen
import kotlinx.coroutines.launch

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun TriggerScreen(modifier: Modifier = Modifier, viewModel: ConfigTriggerViewModel) {
val showFingerprintGestures: Boolean by
viewModel.showFingerprintGesturesShortcut.collectAsStateWithLifecycle()

BaseTriggerScreen(modifier, viewModel, discoverScreenContent = {
TriggerDiscoverScreen(
showFloatingButtons = true,
showFingerprintGestures = showFingerprintGestures,
onShortcutClick = viewModel::showTriggerSetup,
val scope = rememberCoroutineScope()
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)

HandleTriggerSetupBottomSheet(viewModel, sheetState)

if (viewModel.showDiscoverTriggersBottomSheet) {
TriggerDiscoverBottomSheet(
sheetState = sheetState,
onDismissRequest = {
viewModel.showDiscoverTriggersBottomSheet = false
},
content = {
TriggerDiscoverScreen(
showFingerprintGestures = showFingerprintGestures,
onShortcutClick = { shortcut ->
scope.launch {
sheetState.hide()
viewModel.showDiscoverTriggersBottomSheet = false
viewModel.showTriggerSetup(shortcut)
}
},
)
},
)
})
}

BaseTriggerScreen(
modifier = modifier,
viewModel = viewModel,
sheetState = sheetState,
discoverScreenContent = {
TriggerDiscoverScreen(
showFingerprintGestures = showFingerprintGestures,
onShortcutClick = viewModel::showTriggerSetup,
)
},
)
}
4 changes: 2 additions & 2 deletions app/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION_NAME=4.6.2
VERSION_CODE=288
VERSION_NAME=4.7.0
VERSION_CODE=292
1 change: 1 addition & 0 deletions base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ dependencies {

// Tests

testImplementation(project(":test-fixtures"))
testImplementation(libs.junit)
testImplementation(libs.hamcrest.all)
testImplementation(libs.androidx.junit.ktx) // androidx.test.ext:junit-ktx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.multidex.MultiDexApplication
import dagger.Lazy
import io.github.sds100.keymapper.base.expertmode.SystemBridgeAutoStarter
import io.github.sds100.keymapper.base.expertmode.SystemBridgeConfigSync
import io.github.sds100.keymapper.base.keymaps.MappingsStateBroadcastController
import io.github.sds100.keymapper.base.logging.KeyMapperLoggingTree
import io.github.sds100.keymapper.base.logging.SystemBridgeLogger
import io.github.sds100.keymapper.base.settings.Theme
Expand Down Expand Up @@ -73,6 +74,9 @@ abstract class BaseKeyMapperApp : MultiDexApplication() {
@Inject
lateinit var autoGrantPermissionController: Lazy<AutoGrantPermissionController>

@Inject
lateinit var mappingsStateBroadcastController: Lazy<MappingsStateBroadcastController>

@Inject
lateinit var loggingTree: Lazy<KeyMapperLoggingTree>

Expand Down Expand Up @@ -228,6 +232,7 @@ abstract class BaseKeyMapperApp : MultiDexApplication() {
}.launchIn(appCoroutineScope.get())

autoGrantPermissionController.get().start()
mappingsStateBroadcastController.get().start()
keyEventRelayServiceWrapper.get().bind()

if (systemBridgeConnectionManager.get().isConnected()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ object IntentApi {
const val ACTION_RESUME_MAPPINGS = "io.github.sds100.keymapper.ACTION_RESUME_MAPPINGS"
const val ACTION_TOGGLE_MAPPINGS = "io.github.sds100.keymapper.ACTION_TOGGLE_MAPPINGS"

const val ACTION_MAPPINGS_STATE_CHANGED =
"io.github.sds100.keymapper.ACTION_MAPPINGS_STATE_CHANGED"
const val EXTRA_MAPPINGS_PAUSED = "io.github.sds100.keymapper.EXTRA_MAPPINGS_PAUSED"

const val PAUSE_RECEIVER_CLASS =
"io.github.sds100.keymapper.api.PauseMappingsBroadcastReceiver"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import io.github.sds100.keymapper.base.actions.keyevent.FixKeyEventActionBottomS
import io.github.sds100.keymapper.base.compose.KeyMapperTheme
import io.github.sds100.keymapper.base.keymaps.ShortcutModel
import io.github.sds100.keymapper.base.keymaps.ShortcutRow
import io.github.sds100.keymapper.base.onboarding.OnboardingTipModel
import io.github.sds100.keymapper.base.onboarding.TipCard
import io.github.sds100.keymapper.base.utils.ui.SliderMaximums
import io.github.sds100.keymapper.base.utils.ui.SliderMinimums
Expand All @@ -75,7 +74,11 @@ private val linkRowHeight = 48.dp

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ActionsScreen(modifier: Modifier = Modifier, viewModel: ConfigActionsViewModel) {
fun ActionsScreen(
modifier: Modifier = Modifier,
viewModel: ConfigActionsViewModel,
tipContent: (@Composable () -> Unit)? = null,
) {
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
val state by viewModel.state.collectAsStateWithLifecycle()
val optionsState by viewModel.actionOptionsState.collectAsStateWithLifecycle()
Expand Down Expand Up @@ -112,10 +115,24 @@ fun ActionsScreen(modifier: Modifier = Modifier, viewModel: ConfigActionsViewMod

HandleActionBottomSheets(viewModel.createActionDelegate)

val onboardingTipContent: (@Composable () -> Unit)? = actionTipModel?.let { tip ->
{
TipCard(
modifier = Modifier.padding(horizontal = 16.dp),
title = tip.title,
message = tip.message,
isDismissable = tip.isDismissable,
onDismiss = viewModel::onActionTipDismiss,
buttonText = tip.buttonText,
onButtonClick = { viewModel.onTipButtonClick(tip.id) },
)
}
}

ActionsScreen(
modifier = modifier,
state = state,
tipModel = actionTipModel,
tipContent = tipContent ?: onboardingTipContent,
callback = viewModel,
onRemoveClick = viewModel::onRemoveClick,
onAddClick = viewModel::onAddActionClick,
Expand All @@ -128,7 +145,7 @@ fun ActionsScreen(modifier: Modifier = Modifier, viewModel: ConfigActionsViewMod
fun ActionsScreen(
modifier: Modifier = Modifier,
state: State<ConfigActionsState>,
tipModel: OnboardingTipModel? = null,
tipContent: (@Composable () -> Unit)? = null,
callback: ActionListCallback = object : ActionListCallback {},
onAddClick: () -> Unit = {},
onRemoveClick: (String) -> Unit = {},
Expand Down Expand Up @@ -178,7 +195,7 @@ fun ActionsScreen(
ActionList(
modifier = Modifier.weight(1f),
state = state.data,
tipModel = tipModel,
tipContent = tipContent,
callback = callback,
onRemoveClick = onRemoveClick,
onDelayClick = { actionToSetDelay = it },
Expand Down Expand Up @@ -226,7 +243,7 @@ interface ActionListCallback {
private fun ActionList(
modifier: Modifier = Modifier,
state: ConfigActionsState,
tipModel: OnboardingTipModel?,
tipContent: (@Composable () -> Unit)?,
callback: ActionListCallback,
onRemoveClick: (String) -> Unit,
onDelayClick: (String) -> Unit,
Expand Down Expand Up @@ -256,19 +273,9 @@ private fun ActionList(
Arrangement.Top
},
) {
// Display action tip if available
tipModel?.let { tip ->
item {
TipCard(
modifier = Modifier
.padding(horizontal = 16.dp),
title = tip.title,
message = tip.message,
isDismissable = tip.isDismissable,
onDismiss = callback::onActionTipDismiss,
buttonText = tip.buttonText,
onButtonClick = { callback.onTipButtonClick(tip.id) },
)
tipContent?.let { content ->
item(key = "tip", contentType = "tip") {
content()

Spacer(Modifier.height(16.dp))
}
Expand Down Expand Up @@ -548,13 +555,15 @@ private fun EmptyWithShortcutsPreview() {
private fun LoadedPreview() {
KeyMapperTheme {
ActionsScreen(
tipModel = OnboardingTipModel(
id = "id",
title = "Use a dedicated action instead",
message = "Use the \"Flashlight\" action instead.",
isDismissable = false,
buttonText = "Replace action",
),
tipContent = {
TipCard(
modifier = Modifier.padding(horizontal = 16.dp),
title = "Use a dedicated action instead",
message = "Use the \"Flashlight\" action instead.",
isDismissable = false,
buttonText = "Replace action",
)
},
state = State.Data(
ConfigActionsState.Loaded(
actions = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ import io.github.sds100.keymapper.base.system.accessibility.AccessibilityNodeAct
import io.github.sds100.keymapper.base.system.accessibility.AccessibilityNodeModel
import io.github.sds100.keymapper.base.system.accessibility.IAccessibilityService
import io.github.sds100.keymapper.base.system.inputmethod.ImeInputEventInjector
import io.github.sds100.keymapper.base.system.inputmethod.KeyMapperImeHelper
import io.github.sds100.keymapper.base.system.inputmethod.SwitchImeInterface
import io.github.sds100.keymapper.base.system.navigation.OpenMenuHelper
import io.github.sds100.keymapper.base.system.notifications.NotificationController
import io.github.sds100.keymapper.base.utils.getFullMessage
import io.github.sds100.keymapper.base.utils.ui.ResourceProvider
import io.github.sds100.keymapper.base.variables.VariablesUseCase
import io.github.sds100.keymapper.base.vibration.vibrate
import io.github.sds100.keymapper.common.BuildConfigProvider
import io.github.sds100.keymapper.common.utils.InputEventAction
import io.github.sds100.keymapper.common.utils.KMError
import io.github.sds100.keymapper.common.utils.KMError.SdkVersionTooLow
Expand Down Expand Up @@ -83,12 +85,10 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import kotlinx.coroutines.withTimeoutOrNull
import timber.log.Timber

class PerformActionsUseCaseImpl @AssistedInject constructor(
Expand Down Expand Up @@ -130,6 +130,7 @@ class PerformActionsUseCaseImpl @AssistedInject constructor(
private val settingsAdapter: SettingsAdapter,
private val vibratorAdapter: VibratorAdapter,
private val variablesUseCase: VariablesUseCase,
private val buildConfigProvider: BuildConfigProvider,
) : PerformActionsUseCase {

companion object {
Expand All @@ -150,6 +151,9 @@ class PerformActionsUseCaseImpl @AssistedInject constructor(
// from starving the thread pool.
private val gestureDispatcher: CoroutineDispatcher = Dispatchers.IO.limitedParallelism(1)

private val imeHelper: KeyMapperImeHelper =
KeyMapperImeHelper(switchImeInterface, inputMethodAdapter, buildConfigProvider.packageName)

private val openMenuHelper by lazy {
OpenMenuHelper(
service,
Expand Down Expand Up @@ -299,38 +303,16 @@ class PerformActionsUseCaseImpl @AssistedInject constructor(
}

is ActionData.SwitchKeyboard -> {
switchImeInterface.switchIme(action.imeId)

// See issue #1064. Wait for the input method to finish switching before returning.
val chosenIme = withTimeoutOrNull(2000.milliseconds) {
inputMethodAdapter.chosenIme.filterNotNull().first { it.id == action.imeId }
}

if (chosenIme == null) {
result = KMError.SwitchImeFailed
} else {
result = Success(Unit)
}
result = imeHelper.switchImeAndWait(action.imeId)
}

is ActionData.CycleKeyboardLanguage -> {
result = inputMethodAdapter.cycleInputMethodSubtype()
result = imeHelper.cycleKeyboardLanguage()
}

is ActionData.CycleKeyboard -> {
result = inputMethodAdapter.getNextInputMethod().then { nextIme ->
switchImeInterface.switchIme(nextIme.id)

// See issue #1064. Wait for the input method to finish switching before returning.
val chosenIme = withTimeoutOrNull(2000.milliseconds) {
inputMethodAdapter.chosenIme.filterNotNull().first { it.id == nextIme.id }
}

if (chosenIme == null) {
KMError.SwitchImeFailed
} else {
Success(Unit)
}
imeHelper.switchImeAndWait(nextIme.id)
}
}

Expand Down
Loading
Loading