Skip to content

Commit 7e003c4

Browse files
authored
Merge pull request #1640 from keymapperorg/develop
Version 3.0.0
2 parents c9b47bc + c3ee791 commit 7e003c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+724
-558
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,8 @@ Gemfile.lock
8989
app/play-service-account-key.json
9090

9191
app/.env
92-
.venv/
92+
.venv/
93+
/.idea/appInsightsSettings.xml
94+
/.idea/AndroidProjectSystem.xml
95+
/.idea/runConfigurations.xml
96+
/.idea/studiobot.xml

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

.idea/runConfigurations/app.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
## [3.0.0](https://github.com/sds100/KeyMapper/releases/tag/v3.0.0)
2+
3+
_See the changes from previous 3.0 Beta releases._
4+
5+
#### 10 April 2025
6+
7+
- #1635 do not crash if the URL for the HTTP action is malformed
8+
19
## [3.0 Beta 5](https://github.com/sds100/KeyMapper/releases/tag/v3.0.0-beta.5)
210

11+
_See the changes from previous 3.0 Beta releases as well._
12+
313
#### 6 April 2025
414

515
- #1625 HTTP Request action.
616

7-
###
8-
917
## Bug fixes
1018

1119
- #1627 open camera app action does not work when device is locked

README.md

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
**UPDATE**: I miss working on this project and Key Mapper still has so much potential so I am back! 😊
2-
>
3-
> Well, working on this project was a fun ride 🎢! This project has taught me so much about Android, software development and how to collaborate with an online community. It has been my dream to lead a big FOSS project with people from all over the world so a **huge** thank you goes to everyone that spread the word and helped on GitHub along the way ☺.
4-
>
5-
> ~~Unfortunately, I do not have any more time to work on this project - I'm now studying Computer Science at university and I have landed software-dev side jobs, which has taken up any free-time I did have to code on the side.~~
6-
>
7-
> A special thank you goes to everyone in the [Team](https://docs.keymapper.club/#our-team) for their long-term
8-
> commitment to the project and for being so engaged with the community 👏 🎉.
9-
> The Discord server, website and app store listing will still be up! So don't worry, you can still map your keys to your heart's content. ❤
1+
![GitHub release](https://img.shields.io/github/release/keymapperorg/KeyMapper.svg)
2+
![fdroid release](https://img.shields.io/f-droid/v/io.github.sds100.keymapper.svg)
103

114
<p align="center">
125
<img width="200" height="auto" src="https://github.com/sds100/KeyMapper/blob/master/app/src/main/ic_launcher-web.png">
136
<br/>
147

15-
Key Mapper is a free and open source Android app that can remap your buttons and fingerprint reader gestures. The aim of this project is to allow anyone to remap their buttons with (almost) infinite flexibility.
168
</b>
179
</p>
1810

@@ -25,11 +17,47 @@ Key Mapper is a free and open source Android app that can remap your buttons and
2517
<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>
2618
</p>
2719

28-
![GitHub release](https://img.shields.io/github/release/keymapperorg/KeyMapper.svg)
29-
![fdroid release](https://img.shields.io/f-droid/v/io.github.sds100.keymapper.svg)
20+
## Unleash your keys!
21+
22+
Make custom macros on your keyboard or gamepad, make on-screen buttons in any app, and unlock new functionality from your volume buttons!
23+
24+
Key Mapper supports a huge variety of buttons and keys:
25+
26+
- ALL your phone buttons (volume AND side key)
27+
- Game controllers (D-pad, ABXY, and most others)
28+
- Keyboards
29+
- Headsets and headphones
30+
- Fingerprint sensor
31+
32+
Most devices are already supported, with new devices being added over time. Let us know if it's not working for you and we can prioritize your device.
33+
34+
Not currently supported:
35+
- Mouse buttons
36+
- Joysticks and triggers (LT,RT) on gamepads
37+
38+
Not enough keys? Design your own on-screen button layouts and remap those just like real keys!
39+
40+
## What shortcuts can I make?
3041

31-
🎉 Check out the [website](https://docs.keymapper.club) for more information and help! 🎉
42+
With over 100 individual actions, the sky is the limit.
3243

44+
Build complex macros with screen taps and gestures, keyboard inputs, open apps, control media, and even send intents directly to other apps.
45+
46+
47+
## How much control do I have?
48+
49+
TRIGGERS: You decide how to trigger a key map. Long press, double press, press as many times as you like! Combine keys on different devices, and even include your on-screen buttons.
50+
51+
ACTIONS: Design specific macros for what you want to do. Combine over 100 actions, and choose the delay between each one. Set repeating actions to automate and speed up slow tasks.
52+
53+
CONSTRAINTS: You choose when key maps should run and when they shouldn't. Only need it in one specific app? Or when media is playing? On your lockscreen? Constrain your key maps for maximum control.
54+
55+
56+
## Links
57+
58+
Come say hi in our [Discord community!](http://keymapper.club)
59+
60+
Read the [documentation!](https://docs.keymapper.club/?utm_source=github)
3361

3462
## Translations
3563

@@ -41,11 +69,9 @@ Key Mapper is a free and open source Android app that can remap your buttons and
4169
[![sk proofreading](https://img.shields.io/badge/dynamic/json?color=green&label=sk&style=flat&logo=crowdin&query=%24.progress.11.data.approvalProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045-update.json)](https://crowdin.com/project/key-mapper)
4270
[![zh-CN proofreading](https://img.shields.io/badge/dynamic/json?color=green&label=zh-CN&style=flat&logo=crowdin&query=%24.progress.15.data.approvalProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-13864667-360045-update.json)](https://crowdin.com/project/key-mapper)
4371

44-
4572
## Star History
4673

47-
[![Star History Chart](https://api.star-history.com/svg?repos=keymapperorg/KeyMapper&type=Date)](https://star-history.com/#keymapperorg/KeyMapper&Date)
48-
49-
### How do I contribute?
74+
[![Star History Chart](https://api.star-history.com/svg?repos=keymapperorg/KeyMapper&type=Date)](https://www.star-history.com/#keymapperorg/KeyMapper&Date)
75+
## Contributing
5076
There are many ways to help with this project. 😃
51-
Check out the contributing guide in the [documentation](https://docs.keymapper.club).
77+
Check out the contributing guide in the [documentation.](https://docs.keymapper.club/contributing/introduction/?utm_source=github)

app/src/main/assets/whats-new.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Key Mapper 3.0 is here! 🎉
55
🗂️ Grouping key maps into folders with shared constraints.
66

77
🔦 You can now change the flashlight brightness. Tip: use the constraint for when the flashlight is showing to remap your volume buttons to change the brightness.
8+
89
🛜 Send HTTP requests with a new action.
910

1011
❤️ There are also tonnes of improvements to make your key mapping experience more enjoyable.

app/src/main/java/io/github/sds100/keymapper/actions/CreateActionDelegate.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ class CreateActionDelegate(
777777
httpRequestBottomSheetState = ActionData.HttpRequest(
778778
description = "",
779779
method = HttpMethod.GET,
780-
url = "",
780+
url = "http://",
781781
body = "",
782782
authorizationHeader = "",
783783
)

app/src/main/java/io/github/sds100/keymapper/actions/HttpRequestBottomSheet.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import io.github.sds100.keymapper.system.network.HttpMethod
4343
import io.github.sds100.keymapper.util.ui.compose.KeyMapperDropdownMenu
4444
import kotlinx.coroutines.flow.update
4545
import kotlinx.coroutines.launch
46+
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
4647

4748
@OptIn(ExperimentalMaterial3Api::class)
4849
@Composable
@@ -106,6 +107,7 @@ private fun HttpRequestBottomSheet(
106107
val descriptionEmptyErrorString =
107108
stringResource(R.string.action_http_request_description_empty_error)
108109
val urlEmptyErrorString = stringResource(R.string.action_http_request_url_empty_error)
110+
val malformedUrlErrorString = stringResource(R.string.action_http_request_malformed_url_error)
109111

110112
var descriptionError: String? by rememberSaveable { mutableStateOf(null) }
111113
var urlError: String? by rememberSaveable { mutableStateOf(null) }
@@ -272,6 +274,10 @@ private fun HttpRequestBottomSheet(
272274
urlError = urlEmptyErrorString
273275
}
274276

277+
if (state.url.toHttpUrlOrNull() == null) {
278+
urlError = malformedUrlErrorString
279+
}
280+
275281
if (descriptionError == null && urlError == null) {
276282
onDoneClick()
277283
}

app/src/main/java/io/github/sds100/keymapper/home/KeyMapListAppBar.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ fun KeyMapListAppBar(
160160
actions = {
161161
AppBarActions(
162162
onHelpClick,
163+
onSortClick,
163164
onSettingsClick,
164165
onAboutClick,
165166
onExportClick,
@@ -253,11 +254,13 @@ fun KeyMapListAppBar(
253254
AnimatedVisibility(!state.isEditingGroupName) {
254255
AppBarActions(
255256
onHelpClick,
257+
onSortClick,
256258
onSettingsClick,
257259
onAboutClick,
258260
onExportClick,
259261
onImportClick,
260262
showDeleteGroup = true,
263+
showSort = true,
261264
onDeleteGroupClick = {
262265
showDeleteGroupDialog = true
263266
},
@@ -529,11 +532,13 @@ private fun SelectingAppBar(
529532
@Composable
530533
private fun AppBarActions(
531534
onHelpClick: () -> Unit,
535+
onSortClick: () -> Unit,
532536
onSettingsClick: () -> Unit,
533537
onAboutClick: () -> Unit,
534538
onExportClick: () -> Unit,
535539
onImportClick: () -> Unit,
536540
showDeleteGroup: Boolean = false,
541+
showSort: Boolean = false,
537542
onDeleteGroupClick: () -> Unit = {},
538543
) {
539544
var expandedDropdown by rememberSaveable { mutableStateOf(false) }
@@ -555,6 +560,10 @@ private fun AppBarActions(
555560

556561
AppBarDropdownMenu(
557562
expanded = expandedDropdown,
563+
onSortClick = {
564+
expandedDropdown = false
565+
onSortClick()
566+
},
558567
onSettingsClick = {
559568
expandedDropdown = false
560569
onSettingsClick()
@@ -573,6 +582,7 @@ private fun AppBarActions(
573582
},
574583
onDismissRequest = { expandedDropdown = false },
575584
showDeleteGroup = showDeleteGroup,
585+
showSort = showSort,
576586
onDeleteGroupClick = {
577587
expandedDropdown = false
578588
onDeleteGroupClick()
@@ -810,12 +820,14 @@ private fun selectedTextTransition(
810820
@Composable
811821
private fun AppBarDropdownMenu(
812822
expanded: Boolean,
823+
onSortClick: () -> Unit = {},
813824
onSettingsClick: () -> Unit = {},
814825
onAboutClick: () -> Unit = {},
815826
onExportClick: () -> Unit = {},
816827
onImportClick: () -> Unit = {},
817828
onDismissRequest: () -> Unit = {},
818829
showDeleteGroup: Boolean = false,
830+
showSort: Boolean = false,
819831
onDeleteGroupClick: () -> Unit = {},
820832
) {
821833
DropdownMenu(
@@ -830,6 +842,14 @@ private fun AppBarDropdownMenu(
830842
)
831843
}
832844

845+
if (showSort) {
846+
DropdownMenuItem(
847+
leadingIcon = { Icon(Icons.AutoMirrored.Rounded.Sort, contentDescription = null) },
848+
text = { Text(stringResource(R.string.home_app_bar_sort)) },
849+
onClick = onSortClick,
850+
)
851+
}
852+
833853
DropdownMenuItem(
834854
leadingIcon = { Icon(Icons.Rounded.Settings, contentDescription = null) },
835855
text = { Text(stringResource(R.string.home_menu_settings)) },

app/src/main/java/io/github/sds100/keymapper/system/network/AndroidNetworkAdapter.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ class AndroidNetworkAdapter(
170170
} catch (e: IOException) {
171171
Timber.e(e)
172172
return Error.UnknownIOError
173+
} catch (e: IllegalArgumentException) {
174+
return Error.MalformedUrl
173175
}
174176
}
175177
}

0 commit comments

Comments
 (0)