Disabling KeyWiz Codeset Swapping

DISABLING KEYWIZ CODESET SWAPPING

PREFACE

This page details how to disable Alternate Codeset Swapping on the KeyWiz encoder.  This feature allows the encoder to swap between the default (MAME-compatible) codeset, and a custom codeset when the Shazaaam! key is depressed and the P1 Joystick is moved Left or Right.  With the right combination of software (one application that requires a custom set and all others that can be configured to use the MAME defaults), it can be very useful.  It also can be very disconcerting if accidentally activated in the middle of a game.

In fairness to the KeyWiz, I hammer this feature a little excessively below because I personally do not like it.

However, the KeyWiz is primarily designed as a two-player encoder.  In this mode, it provides eight buttons per player, Start and Coin buttons for each player, and four additional buttons for admin functions such as Pause and Escape.   In this mode, you are unlikely to require any Shazaaam! inputs that would be activated during gameplay, so the feature is unlikely to be activated by accident.

Even in a four-player, three-button setup, if you configure MAME to not require Start inputs, and map Pause and Escape to the joystick directionals, you will not need Shazaaam! inputs which can be accidentally activated.  Even if you used Stealth-shifted inputs for Pause and Escape, if you position the buttons carefully, and you are always using the stick connected to the P1 inputs, the feature is unlikely to be accidentally activated.

The main time this would be a problem, is in a four-player panel, where you are using Stealth-shifted inputs for Coin and Start inputs, or both.   However, while not the most common usage, this is a very functional way to use the encoder.

INTRODUCTION

The KeyWiz keyboard encoder can have two sets of input key definitions (codesets) loaded at one time.  The encoder also incorporates a feature known as Alternate Codeset Swapping.  With this feature, holding down the Shazaaam! key and moving the P1 Joystick Left loads the default MAME-compatible key definitions.   Holding down the Shazaaam! key and moving the P1 Joystick Right loads the custom key definitions.

IMHO, this is one of those features that "Seemed like a good idea at the time, but should not have made it into production."  Fortunately, it is fairly easy to disable.  Here is why I personally don't like it:

Let's say you have used Shift Keys for the Coin inputs to get more inputs from your KeyWiz.  You have also loaded a custom codeset to take advantage of these shift keys.  Now in the middle of a game, Player 2 dies and inserts a coin to continue playing at the same time Player 1 jerks left to avoid being killed.  Suddenly, you are in the default codeset instead of the custom one and none of your keys work like they should.

Apart from this:

Let's say you only use your control panel to play MAME and can use the default codeset.  In this case, there really is no reason for you to switch codesets anyway, so the feature would go completely unused.

Now, (going back to my main page example) let's say you discover Microsoft Train Simulator and want to use it with your control panel.  It uses different keys than MAME so you come up with a custom codeset for it.  Now, you can use the alternate codeset swapping to select between the MAME codeset and the Train Simulator codeset, and except for the possibility of accidentally zapping yourself into the wrong codeset, all is good with the world.   (Note that even this example is only true if you are happy with the default codeset for MAME, otherwise, this idea won't work either).

Well, all is good with the world until . . .  you also discover Visual Pinball (or some other program) and want to use it with your KeyWiz.   You happily set up a custom codeset for it too.  But now the alternate code swapping won't work because half the time you want to switch to Visual Pinball, but you previously loaded the Train Simulator set, and half the time you want to switch to Train Simulator and you previously loaded the Visual Pinball set, so . . .

You end up loading the custom codeset for each application at application startup, either by linking to the application in the codeset itself and starting it from the KeyWiz software, or by using the "auto-mode" feature of the software via a shortcut.  Now all is again good with the world, but the feature goes unused again except for those rare occasions when it rears it's ugly head and zaps you back into the default MAME codeset.

Luckily, as I said, it is easy to disable if you don't want it.  Here is how:

IMPLEMENTATION

Method 1 - Assuming you are comfortable with and can do what you want with the KeyWiz default MAME codeset, you can make a custom codeset to match your default codeset, so switching between them has no effect.

Method 2 - If you want to always use a custom codeset, don't use the J1Left input and map another input to J1Left.  The disadvantage to this is that it leaves you with a 31-input encoder, which theoretically has little advantage over a 28-input one. (In the same way that a 36-input encoder would support 4-player 4-button games and coin inputs better than a KeyWiz, but a 35-input encoder wouldn't gain much.)  In reality, this is not a bad solution and is what I ended up using when I planned how to use a KeyWiz for my 4-player 3-button panel.  Because of the Stealth-Shift capability of the KeyWiz, I was able to use shifted inputs for all Coin and Start Inputs, use 28 action inputs plus Pause and Escape, and leave the P1Left and P1Right inputs unconnected, for a 38-input encoder.

Method 3 - Connect the J1Left or J1Right (or both) COM terminals to the Shazaaam! NC terminal.

Here is a Schematic that RandyT provided showing how to disable code swapping when using the Shazaaam feature in Classic mode (see this page for a discussion of the different KeyWiz shift modes).   (See the second schematic for disabling code swapping using the I-PAC Compatibility or Stealth Shift mode features of the KeyWiz):

Click the image to enlarge or better yet, right-click and open in a new window, or download and print out the Word or PDF versions, as I will refer to them in the discussion that follows.

The circuit works by preventing the Joystick Left and Right switches from registering whenever the Shazaaam! button is depressed.  If using removable panels, it would be easier to make these changes on the controls side of the disconnect, rather than the encoder side.

Here is the circuit to use for the I-PAC Compatibility or Stealth modes of the KeyWiz.  (As above, wiring changes are easiest to make on the controls side of swappable panels):

keywiz_advanced_nocodeload.jpg (189489 bytes)

Click the image to enlarge or better yet, right-click and open in a new window, or download and print out the Word or PDF versions, as I will refer to them in the discussion that follows.

If using the I-PAC Compatibility or Stealth Modes, it is necessary to prioritize the shifted inputs and wire the circuit as shown above, with the joystick switches at the "end" of the chain   (Shazaaam!+Y has highest priority above).  In this mode, there is a possibility for the lower priority button in the chain to double-register if a higher priority button is pressed and released, but this is not really any worse than what normally can happen when using shifted inputs.

Here is an explanation in words:

If you depress a higher priority button, all lower priority buttons go dead!  The lower priority buttons can't do anything because their ground connection is severed by the higher button.

If you are holding down a lower priority button and then press a higher priority button, the KeyWiz will think that you released the lower priority button (because you just severed it's ground connection).  When you release the higher priority button, it still releases properly, but also makes the KeyWiz think that you pressed the lower priority button again, because you reconnected the ground line to it.

And here is an example:

Assuming I have the circuit shown above with the J1 Left and J1 Right disabled (so J1L and J1R COM goes to NC on Shazaaam!+X and the COM on Shazaaam!+X connects to the NC on the Shazaaam!+Y, and Shazaaam!+Y is the head of the chain.

Assume I have the following key mappings:

X = P2B6
Y= P2B5
Shazaaam!+Y=Coin 3
Shazaaam!+X=Coin 4

The following will happen:

I press and hold Coin 3, a Coin3 input registers and now I press and release the following keys (keypresses are sent on key depress):

Coin 4 - does not send anything, since the ground circuit is broken by the Coin3 input; will resume sending Coin 4 if I release Coin3.

Joy1 Left or Right - does not send anything, since the ground circuit is broken by the Coin3 input; will resume sending it's normal input if I release Coin3.

P2B6 - sends Coin4 since P2B6 is shifted.

P2B5 - sends Coin3 since P2B5 is shifted.

Now I release Coin 3 and press and hold Coin4, a coin 4 input registers and now I press and release the following keys (keypresses are sent on key depress):

Coin 3 - Sends Coin 3, since the Coin 3 button is higher in the chain; however, when I release Coin 3 an "extra" Coin 4 input is sent, because the Coin 3 button momentarily breaks and reconnects the ground circuit to Coin 3.   Releasing Coin 4 has no effect.

Joy 1 Left or Right - does not send anything, since the ground circuit is broken by the Coin4 input; will resume sending it's normal input I release Coin4.

P2B6 - sends Coin4 since P2B6 is shifted.

P2B5 - sends Coin3 since P2B5 is shifted.

ADVANCED CONCEPTS

Note that if you like the code swapping feature, but don't want to risk activating it accidentally by moving the Joystick Left or Right with the Shazaaam! buttons depressed, it is possible to disable the joystick inputs as shown above and then connect stealth-shifted buttons to the J1 Left and J1 Right inputs (in the normal advanced method as shown on this page).  The buttons will cause the KeyWiz to swap codesets and the joystick will not.