# Macros based on key

**URL:** <https://community.keyboard.io/t/macros-based-on-key/2176>\
**Category:** Programming\
**Created:** [November 7, 2018, 8:55pm UTC](https://community.keyboard.io/t/macros-based-on-key/2176 "2018-11-07T20:55:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [November 7, 2018, 9:35pm UTC](https://community.keyboard.io/t/macros-based-on-key/2176/2 "2018-11-07T21:35:02Z")

</div>

I think you want the PrefixLayers plugin:

> [@PrefixLayers - A Plugin for Screen/Tmux users](https://community.keyboard.io/t/prefixlayers-a-plugin-for-screen-tmux-users/667):
>
> Plugin name: PrefixLayers Source URL: [https://github.com/jamesnvc/Kaleidoscope-PrefixLayer](https://github.com/jamesnvc/Kaleidoscope-PrefixLayer) Description: Inspired by this [neat idea](https://github.com/ilianaw/Model01-Firmware/commit/7dad53bf1855e68a4c93a1686cad5e75b539cb0b) and [@algernon suggesting it be a plugin](https://trunk.mad-scientist.club/@algernon/98920372754259733), I made a plugin that lets you set a prefix sequence of keys to be tapped before every key on a particular layer. The initial purpose was to have a TMUX layer that is mostly transparent and has every key in that layer prefixed with a Ctrl-b. It’s been generalized to have a list of layers and a sequence of keys to be sent fo…

Though, that might not be updated for the v2 plugin API yet… I guess I’ll have to submit a PR to move it forward. The plugin does precisely what you wish to do 🙂

---

_[View the full topic](https://community.keyboard.io/t/macros-based-on-key/2176)._
