# Map Keystroke to MIDI or another Key and suppress the original keystroke

**URL:** <https://forum.bome.com/t/map-keystroke-to-midi-or-another-key-and-suppress-the-original-keystroke/5205>\
**Category:** Tips & Tricks\
**Created:** [May 28, 2023, 11:33am UTC](https://forum.bome.com/t/map-keystroke-to-midi-or-another-key-and-suppress-the-original-keystroke/5205 "2023-05-28T11:33:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlorianBome](https://forum.bome.com/user_avatar/forum.bome.com/florianbome/32/2367_2.png) [@FlorianBome](https://forum.bome.com/u/FlorianBome)\
**Post date:** [May 28, 2023, 11:33am UTC](https://forum.bome.com/t/map-keystroke-to-midi-or-another-key-and-suppress-the-original-keystroke/5205/1 "2023-05-28T11:33:51Z")

</div>

Often, it is useful to use [Bome MIDI Translator Pro](https://www.bome.com/products/miditranslator) for mapping keystrokes on your computer / QWERTY keyboard to send MIDI messages, map to other keys, type text, or do other special actions. MIDI Translator Pro allows for dynamic mappings, too, depending on context or active application, you can use different keystroke mappings.

However, keys on a keyboard have a predefined function. Examples:

- the A key will enter the A letter
- the F12 key is used in many programs for special actions
- the Number Pad keys enter numbers, and so on.

Wouldn’t it be great to be able to use specific keys in Bome MIDI Translator Pro for translations, but disable their normal function?

This is possible using this approach:

1. Redefine specific keys with an unused VK code.  
This will disable their original function.
2. In MIDI Translator Pro, map this key to MIDI, another keystroke, or anything else you like.

Fortunately, Bome MIDI Translator Pro recognizes keys even if their normal function is disabled.

## 1. Redefine Keys

For this example, I’ve used Microsoft Power Toys:  
[Download Microsoft Power Toys](https://aka.ms/installPowerToys)

After installation, the settings allow you to enable the Keyboard Manager:

 ![image](https://forum.bome.com/uploads/default/original/2X/1/19eab9db847673cc521ef993b5e86f92c8e781cb.png)

Click on _Remap a key_.

In this example, I redefine the `0` key on the Number Pad (by clicking _Type_ and then pressing the key), then map it to an unused VK code 140 using the drop-down list (generally, VK codes above 128 are unused):

 ![image](https://forum.bome.com/uploads/default/original/2X/0/0e6a5a54c4b105b993c145ab9bc7fc0b80911853.png)

Press `OK`, then press _Continue Anyway_ when a warning tells you that the key does not have assignments. This is exactly what we want!

Now try in a text editor or elsewhere: pressing the `Num0` key will not enter a 0, but just do nothing.

## 2. Map the key in Bome MIDI Translator Pro

Open Bome MIDI Translator Pro, and create a new Translator entry. As _Incoming_ action, select _Key Stroke_. Select _Physical Keys_ and click into the empty field. Press the `Num0` key: it will be detected as `Num 0([VK 140])`:

 ![image](https://forum.bome.com/uploads/default/original/2X/1/1ebcf7a941f870d420bf8ca439e75552f0ca171e.png)

Now as outgoing action, you can define anything you like, for example send a MIDI message, issue a keyboard shortcut, launch a program or switch to a specific window, and so on.  
As an example, we send a Control Change message:

 ![image](https://forum.bome.com/uploads/default/original/2X/b/b8139ce71b7e8cdeb498eb2a71f73e18ce446a6c.png)

Now, whenever you press the Num0 key, other applications ignore it, but the MIDI message is sent to the MIDI device you defined in Bome MIDI Translator Pro.

And of course, you can use different presets, Shift, Ctrl and other modifiers as you like to make even more use of this redefined key.

**Note 1** : it seems that Num ENTER cannot be mapped in this way: it is seen as a normal ENTER key, so you’d map both at once.  
**Note 2** : there are other ways to remap keys to an undefined function. With other tools (like [SharpKeys](https://github.com/randyrants/sharpkeys)), you can modify the registry to map the scan code of keys, which is a more low level way, but Bome MIDI Translator Pro also recognizes undefined scan codes.

## MacOS?

We haven’t tried this on MacOS, but in general, Bome MIDI Translator Pro also recognizes keys on MacOS if they’re mapped to undefined functions.
