Rearrange the file layout in preparation of becoming a monorepo

Move the documentation to `doc/plugin/TopsyTurvy.md`, sources under
`src/kaleidoscope/plugin/` (appropriately namespaced). This is in preparation of
merging plugins into a single monorepo.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/389/head
Gergely Nagy 6 years ago
parent b73588055e
commit 265cbde980
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -5,52 +5,4 @@
[travis:image]: https://travis-ci.org/keyboardio/Kaleidoscope-TopsyTurvy.svg?branch=master
[travis:status]: https://travis-ci.org/keyboardio/Kaleidoscope-TopsyTurvy
`TopsyTurvy` is a plugin that inverts the behaviour of the `Shift` key for some
selected keys. That is, if configured so, it will input `!` when pressing the
`1` key without `Shift`, but with the modifier pressed, it will input the
original `1` symbol.
## Using the plugin
To use the plugin, one needs to include the header, mark keys to apply plugin
effects to, and use the plugin:
```c++
#include <Kaleidoscope.h>
#include <Kaleidoscope-TopsyTurvy.h>
// In the keymap:
TOPSY(1), TOPSY(2), TOPSY(3)
KALEIDOSCOPE_INIT_PLUGINS(TopsyTurvy);
void setup () {
Kaleidoscope.setup ();
}
```
## Keymap markup
There is only one macro that the plugin provides, which one can use in keymap definitions:
### `TOPSY(key)`
> Mark the specified `key` (without the `Key_` prefix!) for TopsyTurvy, and swap
> the effect of `Shift` when the key is used. One can have any number of
> topsy-turvy keys on a keymap.
>
> The keys must be plain old keys, modifiers or anything other augmentation
> cannot be applied.
The plugin provides a number of macros one can use in keymap definitions:
## Plugin methods
The plugin provides the `TopsyTurvy` object, without any public methods or properties.
## Further reading
Starting from the [example][plugin:example] is the recommended way of getting
started with the plugin.
[plugin:example]: https://github.com/keyboardio/Kaleidoscope-TopsyTurvy/blob/master/examples/TopsyTurvy/TopsyTurvy.ino
See [doc/plugin/TopsyTurvy.md](doc/plugin/TopsyTurvy.md) for documentation.

@ -0,0 +1,51 @@
# Kaleidoscope-TopsyTurvy
`TopsyTurvy` is a plugin that inverts the behaviour of the `Shift` key for some
selected keys. That is, if configured so, it will input `!` when pressing the
`1` key without `Shift`, but with the modifier pressed, it will input the
original `1` symbol.
## Using the plugin
To use the plugin, one needs to include the header, mark keys to apply plugin
effects to, and use the plugin:
```c++
#include <Kaleidoscope.h>
#include <Kaleidoscope-TopsyTurvy.h>
// In the keymap:
TOPSY(1), TOPSY(2), TOPSY(3)
KALEIDOSCOPE_INIT_PLUGINS(TopsyTurvy);
void setup () {
Kaleidoscope.setup ();
}
```
## Keymap markup
There is only one macro that the plugin provides, which one can use in keymap definitions:
### `TOPSY(key)`
> Mark the specified `key` (without the `Key_` prefix!) for TopsyTurvy, and swap
> the effect of `Shift` when the key is used. One can have any number of
> topsy-turvy keys on a keymap.
>
> The keys must be plain old keys, modifiers or anything other augmentation
> cannot be applied.
The plugin provides a number of macros one can use in keymap definitions:
## Plugin methods
The plugin provides the `TopsyTurvy` object, without any public methods or properties.
## Further reading
Starting from the [example][plugin:example] is the recommended way of getting
started with the plugin.
[plugin:example]: https://github.com/keyboardio/Kaleidoscope-TopsyTurvy/blob/master/examples/TopsyTurvy/TopsyTurvy.ino

@ -17,4 +17,4 @@
#pragma once
#include <Kaleidoscope/TopsyTurvy.h>
#include <kaleidoscope/plugin/TopsyTurvy.h>

@ -19,6 +19,7 @@
#include "kaleidoscope/hid.h"
namespace kaleidoscope {
namespace plugin {
uint8_t TopsyTurvy::last_pressed_position_;
bool TopsyTurvy::is_shifted_;
@ -68,6 +69,7 @@ EventHandlerResult TopsyTurvy::onKeyswitchEvent(Key &mapped_key, byte row, byte
return EventHandlerResult::EVENT_CONSUMED;
}
}
}
kaleidoscope::TopsyTurvy TopsyTurvy;
kaleidoscope::plugin::TopsyTurvy TopsyTurvy;

@ -23,6 +23,7 @@
#define TOPSY(k) (Key) { .raw = kaleidoscope::ranges::TT_FIRST + (Key_ ## k).keyCode }
namespace kaleidoscope {
namespace plugin {
class TopsyTurvy: public kaleidoscope::Plugin {
public:
@ -35,7 +36,7 @@ class TopsyTurvy: public kaleidoscope::Plugin {
static bool is_shifted_;
static bool is_active_;
};
}
}
extern kaleidoscope::TopsyTurvy TopsyTurvy;
extern kaleidoscope::plugin::TopsyTurvy TopsyTurvy;
Loading…
Cancel
Save