SDLMESS and the New Apple Keyboard

SDLMESS inherited it’s keyboard handling code from mainline MESS. Mainline MESS uses the Scroll Lock key to toggle between User Interface modes. On the Mac, SDLMESS has a conditional compile to use the Insert key instead of the other key. This worked well before the new Apple keyboard.

The new Apple keyboard has removed the Insert key and replaced it with an fn key. A press on this key is never sent to the operating system. It changes a mode internal to the keyboard. This is good and bad for SDLMESS on the Macintosh.

Thankfully SDLMESS has no hardwired keys in the software. All keys can be reassigned in the tab menu. But the one catch-22 situation is the User Interface Mode toggle key. If this key is inaccessible, you are stuck with no access to the tab menu. About a year ago I saw this situation with some Macintosh laptop computers and submitted a patch to assign the keyboard mode key on the command line or inside the INI file. The switch is uimodekey. Since I have the new keyboard I changed it to ITEM_ID_DEL. This is the key directly below the fn key. This is a good way to solve the problem.

There is also a benefit to the new Apple keyboard. Apple has been assigning many different functions to the function keys (F1-F12) over the past few years and SDLMESS also assigns functions to the functions keys. Since Mac OS X would take precedence, SDLMESS would never receive the keydowns and it would look like SDLMESS was malfunctioning. If you hold the fn key and then press a function key, SDLMESS will receive the keydown and the system will ignore the key. You can even reverse this in the system preferences.