Tutorial: How to use any secondary PC keyboard to control MSFS events and variables via SPAD.neXt and MIDI commands

The idea is simple: I’ve been using the full version of SPAD.neXt which includes MIDI support and, as such, can utilize devices such as Behringer Xtouch Mini or Novation Launchpad Mini to control MSFS. In particular to control things that cannot be mapped directly via in-game settings, for example all L:VAR/H:VAR variables which are very common in 3rd party aircraft (WT CJ4, Piper P28R, CRJ and so on).

Although a full blown MIDI controller with dozens of keys and knobs would be ideal, they also don’t come cheap. So what if I could use a secondary PC keyboard as a dedicated input, masking it as a virtual MIDI device? I would effectively have as many keys as I wanted for free (except the initial purchase of SPAD.neXt). The solution can scale up to as many additional keyboards as we want to.

What I did in 10 easy steps was:

DISCLAIMER: Best to try this with TWO keyboards connected to your PC, otherwise you may end up locking your input if you are only using one keyboard. If this happens then try killing UCR via CTRL+ALT+DEL and Task Manager. In the worst case scenario, you will need to use the power button on your PC to reset it.

  1. Download UCR, which enables us to map any device input to any device output. No installation is needed. No need to launch it just yet.

  2. Install UCR’s Core Interception software, which is essentially a driver which captures our secondary keyboard’s keystrokes before they reach Windows. All we need is to run executable “\Interception\command line installer\install-interception.exe” (as admins via command prompt) and reboot. Sounds fishy but it seems to be legit software, has been around for years and is well known to the community.

  3. Enable Core Interception’s blocking feature, which allows UCR to prevent our secondary keyboard’s keystrokes from registering in Windows as standard input. This will effectively result in the second keyboard sending only MIDI commands to MSFS and nothing else (so we’ll avoid any key conflicts). Enabling the blocking feature is as easy as updating the value of “BlockingEnabled” config item found in “UCR_v0.9.0\Providers\Core_Interception\Settings.xml” from False to True.

  4. Add 3 DLL files to UCR, found in a plugin called MapToMidi.zip and downloaded from here. The DLLs are essentially plugins which will add MIDI mapping features to UCR and will allow us to map keyboard buttons to MIDI commands. The installation instructions are as follows: “Extract the 3 DLL files and place Core_Midi.dll in UCR’s /Providers/Core_Midi/ and the other two files in /Plugins/UCR.Plugins/”.

  5. Install LoopBe1, which is free software (as long as it’s not used for commercial reasons) which adds a MIDI device in Windows.
    image
    We will need this as the output for UCR and also the MIDI input device for SPAD.neXt.

  6. Launch UCR, create a new profile and set your secondary keyboard as input and LoopBe as the MIDI output:

  7. In UCR’s Plugins menu, select “Midi → Button to Midi” and create a new keybind such as this:


    You can use any MIDI output command you like, I prefer notes because they’re simpler. Just make sure you use a different note for each keystroke (thankfully there are several octaves there) and also remember to enable both “Block” and “Disable Key Repeat” for good measure. As described in step (3) this will prevent Windows from registering our keystrokes as standard input.

  8. As soon as you are happy with your UCR bindings, activate your profile (press that Play icon on top left).

  9. Launch SPAD.neXt, enable General MIDI support (if you haven’t already):

  10. Go to Panels. Your LoopBe MIDI device should be there. It’ll probably be empty of all keys, but as soon as you start pressing keys on your secondary keyboard you’ll see them appearing in SPAD.neXt. This is standard behaviour for this app for all MIDI devices. In this particular example I have mapped all A-to-N keys of my secondary keyboard, assigned “A” to a random SimConnect event (toggle beacon lights) and this is how they appear:

So for example this is how you could easily map all A-Z and 0-9 keys to their respective MCDU buttons of WT CJ4 or CRJ (both are using L:VAR/H:VARs for all these things). Took about half an hour to get all mapping done, the only MCDU buttons I didn’t assign were the LSKs because keyboard layouts aren’t really ideal for those side selectors.

7 Likes

You just gave me an idea for the next thing I’ll do with my guitar!

2 Likes

Yes, using a standard keyboard as a MIDI controller may have lots of potential for lots of different uses. Pretty sure others have thought of all that a few dozen years before I did, so I’ve only tailored my solution to fit my exact needs (i.e. very specific MSFS controls via spad.next)

For example an option would be to not use two keyboards. Instead use half your keyboard as standard input for Windows (not map anything, not block any keystrokes) and then block the rest and map it to MIDI commands. This way we could e.g. use numpad or other right hand side keys for specific tasks and leave the rest intact.

Also this is obviously targeted to those who already have spad.next and don’t want to spend any money at all for any additional peripherals. If you already own a device such as RealSimGear GCU47X for X-Plane & P3D - RealSimGear.com then you won’t care about lame MIDI workarounds. Otherwise buying a Novation Launchpad mini at anywhere between 60 to 95 Euros can be a preferable solution (not for me, as I’d then have to label the MIDI pad buttons, whereas with a keyboard I already know which key does what if I only use it for MCDU alphanumeric input).

Tonight’s project will be to set up a Riitek mini i8 for MCDU input, as it’s more ideal for this task rather than a standard sized keyboard. In the meantime I ordered the 6x2 keys version of this rather cheap mini mechanical USB keyboard ($20), which would be just perfect to map LSKs or other stuff in GA aircraft.

Question Zeppos if you would be so kind… what can you set the mini keyboard to do? can you use the touch function? would love to know about your final implementation so keep us updated.

I’m working on this as we speak. I’ve set up the alphanumeric keys of Rii mini to do the obvious: each letter or number is the respective A-Z and 0-9 button in WT CJ4 and CRJ. I’ve essentially mapped everything that can be used for typing in MCDU: dot, plus/minus, spacebar, slash, delete and I’m using Enter as EXEC.

The rest of the MCDU buttons (such as FPLN, IDX, LEGS etc) I’ll either map in F1-F10 keys of Rii mini, or I’ll just leave them in Elgato Stream Deck.

Transferring mappings from yesterday’s Logitech keyboard to today’s Rii mini was a matter of minutes as I duplicated the profile’s XML text and then replaced the device IDs in URC’s “content.xml” file (where the app stores everything). Here’s an example for registering keyboard key “A” to MIDI virtual button “24” (that’s Octave 0, C note):

    <Profile Title="MSFS Rii mini i8+" Guid="7b817eee-1ed0-439e-9a36-7f5bd7261c7a">
      <ChildProfiles />
      <Mappings>
        <Mapping Title="A">
          <DeviceBindings>
            <DeviceBinding IsBound="true" DeviceConfigurationGuid="e59b6a45-61ee-4c2a-8cb6-1755c16a243e" KeyType="1" KeyValue="29" KeySubValue="0" Block="true" />
          </DeviceBindings>
          <Plugins>
            <Plugin xsi:type="ButtonToMidi">
              <Outputs>
                <DeviceBinding IsBound="true" DeviceConfigurationGuid="9edf5acf-c489-423c-a902-a0be9a075e74" KeyType="0" KeyValue="144" KeySubValue="24" />
              </Outputs>
              <Filters />
              <Value>127</Value>
              <NoRepeat>true</NoRepeat>
            </Plugin>
          </Plugins>
        </Mapping>
...

All I had to do was to batch-replace “DeviceConfigurationGuid” for input and output devices and the Rii mini profile was ready to be used. Since I had already done the SPAD.neXt mapping yesterday and had assigned the above MIDI “24” button to HTML-event “CJ4_FMC_1_BTN_A”, there was nothing more to be done. Pressing “A” in Rii mini, types “A” in CJ4’s MCDU and it’s as simple as that.

However one of my main incentives to switch from Logitech to Rii mini keyboard (apart from the smaller and more manageable size) was the keys on each side of the touchpad area, which would be ideal for LSKs.

Sadly it turns out this cannot be done, because by default they register as media keys and according to Multimedia Key Input · Issue #80 · Snoothy/UCR · GitHub such keys cannot be intercepted via USB, only PS/2. Which kinda ruins much of my plan, but I don’t mind that much as I’ve already ordered a set of 6 mechanical keys in 2 rows, as seen in this setup:

Less than 20 euros from 2/3/4/6/9/12 Keys Mini Mechanical Keyboard Keycaps For Photoshop Drawing Gaming USB Macro Custom Programmable Keyboard Keypad|Keyboards| - AliExpress if anyone’s interested. I believe that this too works as standard HID keyboard, so I should hopefully be able to map it via MIDI to MSFS.

I’m not sure about the touch function to be honest. Obviously it can be used in MSFS as a regular mouse, but I haven’t thought of any use for it. I think URC and its default plugins support interception of mouse axis. However the additional MapToMidi plugin (which is required to do the UCR mappings specifically to MIDI) doesn’t seem to support mouse axes at all, only mouse buttons. So it can’t be further mapped to e.g. emulate some MSFS axis in SPAD.neXt.

ps: SPAD.neXt’s roadmap includes a feature where keyboard input will be used to send events to MSFS, but I’m not sure if it’ll support secondary keyboards out of the box (due to the obvious Windows limitations). In any case this will make things simpler in the future as we won’t need the whole button-to-MIDI workaround, just a way to intercept keystrokes from standard keyboards.

1 Like

And here it is:

All of CJ4’s MCDU buttons mapped on a lowly Rii mini keyboard. Not realistic but it does the job and it’s cheap.

Configured like this:

Also LSKs are controlled via this small 6x2 programmable keyboard (again mapped as a MIDI):

IMG_20231230_130840

1 Like

Congrats man

1 Like

Actually I believe that SPAD now supports MIDI commands in the basic version as well (priced at around 25 EUR) so doesn’t necessarily require the much more expensive Ultimate version (at 90 EUR).

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.