Merge pull request #451 from keyboardio/unicode/input-delay

Unicode: Add a way to slow it all down
pull/453/head
Jesse Vincent 6 years ago committed by GitHub
commit 9bd897526d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -67,6 +67,14 @@ functionality.
> Finishes the Unicode input method, in an OS-specific way.
### `.input_delay([delay])`
> Sets or returns (if called without an argument) the number of milliseconds to
> wait between inputting each part of the sequence. In some cases, inputting too
> fast does not give the host enough time to process, and a delay is needed.
>
> Defaults to zero, no delay.
## Overrideable methods
### `hexToKey(hex_digit)`

@ -21,6 +21,8 @@
namespace kaleidoscope {
namespace plugin {
uint8_t Unicode::input_delay_;
void Unicode::start(void) {
switch (::HostOS.os()) {
case hostos::LINUX:
@ -62,6 +64,7 @@ void Unicode::input(void) {
unicodeCustomInput();
break;
}
delay(input_delay_);
}
void Unicode::end(void) {

@ -32,6 +32,15 @@ class Unicode : public kaleidoscope::Plugin {
static void type(uint32_t unicode);
static void typeCode(uint32_t unicode);
static void input_delay(uint8_t delay) {
input_delay_ = delay;
}
static uint8_t input_delay() {
return input_delay_;
}
private:
static uint8_t input_delay_;
};
}
}

Loading…
Cancel
Save