Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## [4.5.0](https://github.com/sds100/KeyMapper/releases/tag/v4.5.0)

#### TO BE RELEASED

## Added

- #701 new action options bottom sheet design.
- #701 you can now give custom names to actions, to make it easier to identify key maps.
- #701 redesigned the action list with expandable action cards that show each option and error.
- #1465 actions can be turned off individually without deleting them.
- #701 the delay before the next action is now set with a button between actions instead of in the action options.

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

#### TO BE RELEASED
Expand All @@ -12,6 +24,7 @@

## Added

- Redesigned the action options with grouped repeat, burst, hold down and delay sections, and actions can now be given a custom name.
- #2238 Add a "Reduce app killing" card to Expert Mode on Xiaomi/Redmi/Poco devices with steps to whitelist the app from battery optimisation, disable MIUI optimization, enable autostart, and adjust battery saver settings.
- Target Android 17 SDK.
- [#2227](https://github.com/keymapperorg/KeyMapper/issues/2227) Add a step to the Expert Mode setup wizard to grant local network access permission, required for ADB on Android 17+.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ data class Action(

val multiplier: Int? = null,
val delayBeforeNextAction: Int? = null,

/**
* A name set by the user that is shown instead of the generated title.
*/
val customName: String? = null,

/**
* Disabled actions are not performed when the key map is triggered.
*/
val isEnabled: Boolean = true,
)

object ActionEntityMapper {
Expand Down Expand Up @@ -85,6 +95,11 @@ object ActionEntityMapper {
.valueOrNull()
?.toIntOrNull()

val customName = entity.extras
.getData(ActionEntity.EXTRA_CUSTOM_NAME)
.valueOrNull()
?.takeIf { it.isNotBlank() }

return Action(
uid = entity.uid,
data = data,
Expand All @@ -98,6 +113,8 @@ object ActionEntityMapper {
holdDownDuration = holdDownDuration,
delayBeforeNextAction = delayBeforeNextAction,
multiplier = multiplier,
customName = customName,
isEnabled = !entity.flags.hasFlag(ActionEntity.ACTION_FLAG_DISABLED),
)
}

Expand All @@ -118,6 +135,10 @@ object ActionEntityMapper {
add(EntityExtra(ActionEntity.EXTRA_MULTIPLIER, action.multiplier.toString()))
}

if (!action.customName.isNullOrBlank()) {
add(EntityExtra(ActionEntity.EXTRA_CUSTOM_NAME, action.customName))
}

if (keyMap.isHoldingDownActionBeforeRepeatingAllowed(action) &&
action.holdDownDuration != null
) {
Expand Down Expand Up @@ -185,6 +206,10 @@ object ActionEntityMapper {
flags = flags.withFlag(ActionEntity.ACTION_FLAG_HOLD_DOWN)
}

if (!action.isEnabled) {
flags = flags.withFlag(ActionEntity.ACTION_FLAG_DISABLED)
}

return@map ActionEntity(
type = base.type,
data = base.data,
Expand Down
Loading
Loading