# Process to create a new keybind

**URL:** https://community.aseprite.org/t/process-to-create-a-new-keybind/27372
**Category:** Development
**Created:** [September 16, 2025, 1:44pm UTC](https://community.aseprite.org/t/process-to-create-a-new-keybind/27372 "2025-09-16T13:44:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Willsbr](https://community.aseprite.org/user_avatar/community.aseprite.org/willsbr/32/23118_2.png) [@Willsbr](https://community.aseprite.org/u/Willsbr)
#### Post date: [September 16, 2025, 1:44pm UTC](https://community.aseprite.org/t/process-to-create-a-new-keybind/27372/1 "2025-09-16T13:44:37Z")

</div>

Heyo, I’m trying to create a custom keybind in the source code to execute code for a off screen eyedropper, as It seemed like it would be a better method then rewriting how Aseprite handles click events. However I’m a bit lost as to how exactly I can create a custom keybind. I’m looking through commands.cpp and I have no idea how to link my custom command to a keybind?

---

<div class="post-metadata">

### Author: ![Willsbr](https://community.aseprite.org/user_avatar/community.aseprite.org/willsbr/32/23118_2.png) [@Willsbr](https://community.aseprite.org/u/Willsbr)
#### Post date: [September 16, 2025, 3:27pm UTC](https://community.aseprite.org/t/process-to-create-a-new-keybind/27372/2 "2025-09-16T15:27:20Z")

</div>

Adding what I’ve done so far, this is roughly what I’ve done  
In the commands folder, created cmd\_my\_custom.cpp

 ![image](https://community.aseprite.org/uploads/default/original/3X/a/4/a4f700872b19284bfafd0d6ff44c7e4628b1960b.png)

I know it will crash if it works, I just want to instantly know if it’s working or not.

I’ve added to gui.xml (Removed the \>\< symbols because it wouldn’t copy)  
” key command=“MyCustomCommand” shortcut=“Alt+K” mac=“Cmd+Alt+K”/ “

to the Commands CMakeLists.txt

“commands/cmd\_my\_custom.cpp”

for it’s target sources

and in the commands\_lists.h  
”FOR\_EACH\_COMMAND(MyCustom)”

This currently compiles but my command doesn’t run, and because so much of this code transcription stuff is generated through production I’m completely lost on what exactly I’m missing from this logic.
