Update whitespace per new astyle rules

pull/389/head
Jesse Vincent 8 years ago
parent a02fc71a3b
commit 88fc70f90a
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -47,7 +47,6 @@ const Key keymaps[][ROWS][COLS] PROGMEM = {
void setup() {
Kaleidoscope.setup(KEYMAP_SIZE);
Kaleidoscope.use(&HostOS, &Unicode, NULL);
Unicode.type(0x2328);
}

@ -23,13 +23,11 @@ namespace KaleidoscopePlugins {
Unicode::Unicode(void) {
}
void
Unicode::begin (void) {
void Unicode::begin(void) {
::HostOS.begin();
}
void
Unicode::start (void) {
void Unicode::start(void) {
switch (::HostOS.os()) {
case HostOS::LINUX:
Keyboard.press(Key_LeftControl.keyCode);
@ -60,8 +58,7 @@ Unicode::start (void) {
}
}
void
Unicode::input (void) {
void Unicode::input(void) {
switch (::HostOS.os()) {
case HostOS::LINUX:
case HostOS::WINDOWS:
@ -75,8 +72,7 @@ Unicode::input (void) {
}
}
void
Unicode::end (void) {
void Unicode::end(void) {
switch (::HostOS.os()) {
case HostOS::LINUX:
Keyboard.press(Key_Spacebar.keyCode);
@ -96,20 +92,16 @@ Unicode::end (void) {
}
}
void
Unicode::typeCode (uint32_t unicode) {
void Unicode::typeCode(uint32_t unicode) {
bool onZeroStart = true;
for (int8_t i = 7; i >= 0; i--) {
if (i <= 3) {
onZeroStart = false;
}
uint8_t digit = ((unicode >> (i * 4)) & 0xF);
if (digit == 0) {
if (onZeroStart == false) {
Key key = hexToKey(digit);
input();
Keyboard.press(key.keyCode);
Keyboard.sendReport();
@ -119,60 +111,45 @@ Unicode::typeCode (uint32_t unicode) {
}
} else {
Key key = hexToKey(digit);
input();
Keyboard.press(key.keyCode);
Keyboard.sendReport();
input();
Keyboard.release(key.keyCode);
Keyboard.sendReport();
onZeroStart = false;
}
delay(5);
}
}
void
Unicode::type (uint32_t unicode) {
void Unicode::type(uint32_t unicode) {
start();
typeCode(unicode);
end();
}
} // namespace KaleidoscopePlugins
__attribute__((weak))
Key
hexToKey (uint8_t hex) {
__attribute__((weak)) Key hexToKey(uint8_t hex) {
uint8_t m;
if (hex == 0x0) {
return Key_0;
}
if (hex < 0xA) {
m = Key_1.keyCode + (hex - 0x1);
} else {
m = Key_A.keyCode + (hex - 0xA);
}
return { m, KEY_FLAGS };
}
__attribute__((weak))
void
unicodeCustomStart (void) {
__attribute__((weak)) void unicodeCustomStart(void) {
}
__attribute__((weak))
void
unicodeCustomEnd (void) {
__attribute__((weak)) void unicodeCustomEnd(void) {
}
__attribute__((weak))
void
unicodeCustomInput (void) {
__attribute__((weak)) void unicodeCustomInput(void) {
}
KaleidoscopePlugins::Unicode Unicode;

Loading…
Cancel
Save