Error when installing additional SpaceCadet modifier keys [kaliedoscope does not name a type]

Hi there,

Been trying to expand my SpaceCadet install to include {} and [], and it is not working as per the documentation. I added:

   //Set the keymap with a 250ms timeout per-key
  //Setting is {KeyThatWasPressed, AlternativeKeyToSend, TimeoutInMS}
  //Note: must end with the SPACECADET_MAP_END delimiter
  static kaleidoscope::SpaceCadet::KeyBinding spacecadetmap[] = {
    {Key_LeftShift, Key_LeftParen, 250}
    , {Key_RightShift, Key_RightParen, 250}
    , {Key_LeftGui, Key_LeftCurlyBracket, 250}
    , {Key_RightAlt, Key_RightCurlyBracket, 250}
    , {Key_LeftAlt, Key_RightCurlyBracket, 250}
    , {Key_LeftControl, Key_LeftBracket, 250}
    , {Key_RightControl, Key_RightBracket, 250}
    , SPACECADET_MAP_END
  };
  //Set the map.
  SpaceCadet.map = spacecadetmap;

to my void setup() but I get the following error when building:

/Users/rami/Documents/Arduino/Model01-Firmware/Model01-Firmware.ino: In function 'void setup()':
Model01-Firmware:580:24: error: 'SpaceCadet' in namespace 'kaleidoscope' does not name a type
   static kaleidoscope::SpaceCadet::KeyBinding spacecadetmap[] = {
                        ^
Model01-Firmware:591:20: error: 'spacecadetmap' was not declared in this scope
   SpaceCadet.map = spacecadetmap;
                    ^
exit status 1
'SpaceCadet' in namespace 'kaleidoscope' does not name a type

Any help would be appreciated.

We moved the plugins to a different namespace a while ago, so if you updated Kaleidoscope since you first made your sketch, a few things will need to be adapted, SpaceCadet included. In this case, replace static kaleidoscope::SpaceCadet::KeyBinding spacecadetmap[] with static kaleidoscope::plugin::KeyBinding spacecadetmap[], and that should do the trick.

Thank you algernon, I changed that line to what you recommended…but I am still getting the error.

Arduino: 1.8.8 (Mac OS X), Board: “Keyboardio Model 01”

/Users/rami/Documents/Arduino/Model01-Firmware/Model01-Firmware.ino: In function 'void setup()':
Model01-Firmware:578:32: error: 'KeyBinding' in namespace 'kaleidoscope::plugin' does not name a type
   static kaleidoscope::plugin::KeyBinding spacecadetmap[] = {
                                ^
Model01-Firmware:589:20: error: 'spacecadetmap' was not declared in this scope
   SpaceCadet.map = spacecadetmap;
                    ^
exit status 1
'KeyBinding' in namespace 'kaleidoscope::plugin' does not name a type

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Ooops, my bad, sorry! static kaleidoscope::plugin::SpaceCadet::KeyBinding spacecadetmap[] is the correct one.

Thanks that worked. Why is this not in the docs? Has SpaceCadet fallen out of favor for some other plugin? I see it’s archived.

It’s been merged to the Kaleidoscope repo, and the docs there are up to date. We should probably have left comments in the separate plugin repos README files…

@algernon Yeah, hugely strong vote here for leaving comments in the plugin repo README files. I’m new to Keyboard.io and keep getting super confused and tripped up by out of date plugin repo docs. I’m pretty sure somewhere (maybe the main repo wiki?) even points to plugin repos as documentation on the plugins…

I know now that the “real” docs are in the main repo, but I think this will just continue to be a source of frustration for new users.

1 Like

Yes, agree. It still confuses me every time.