Skip to content

Commit 037abf3

Browse files
committed
fixing whitespaces caused by editor-settings
1 parent 3ce729f commit 037abf3

File tree

2 files changed

+45
-45
lines changed

2 files changed

+45
-45
lines changed

src/keycode.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "os.h"
66

77
#ifdef __cplusplus
8-
extern "C"
8+
extern "C"
99
{
1010
#endif
1111

@@ -14,7 +14,7 @@ extern "C"
1414
#include <Carbon/Carbon.h> /* Really only need <HIToolbox/Events.h> */
1515
#include <ApplicationServices/ApplicationServices.h>
1616
#import <IOKit/hidsystem/ev_keymap.h>
17-
17+
1818
enum _MMKeyCode {
1919
K_NOT_A_KEY = 9999,
2020
K_BACKSPACE = kVK_Delete,

src/robotjs.cc

+43-43
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ int mouseDelay = 10;
1818
int keyboardDelay = 10;
1919

2020
/*
21-
__ __
22-
| \/ | ___ _ _ ___ ___
21+
__ __
22+
| \/ | ___ _ _ ___ ___
2323
| |\/| |/ _ \| | | / __|/ _ \
2424
| | | | (_) | |_| \__ \ __/
2525
|_| |_|\___/ \__,_|___/\___|
@@ -238,21 +238,21 @@ NAN_METHOD(setMouseDelay)
238238
info.GetReturnValue().Set(Nan::New(1));
239239
}
240240

241-
NAN_METHOD(scrollMouse)
241+
NAN_METHOD(scrollMouse)
242242
{
243243
Nan::HandleScope scope;
244244

245245
//Get the values of magnitude and direction from the arguments list.
246-
if(info.Length() == 2)
246+
if(info.Length() == 2)
247247
{
248248
int scrollMagnitude = info[0]->Int32Value();
249249
char *s;
250250

251251
Nan::Utf8String sstr(info[1]);
252252
s = *sstr;
253-
253+
254254
MMMouseWheelDirection scrollDirection;
255-
255+
256256
if (strcmp(s, "up") == 0)
257257
{
258258
scrollDirection = DIRECTION_UP;
@@ -265,26 +265,26 @@ NAN_METHOD(scrollMouse)
265265
{
266266
return Nan::ThrowError("Invalid scroll direction specified.");
267267
}
268-
268+
269269
scrollMouse(scrollMagnitude, scrollDirection);
270270
microsleep(mouseDelay);
271-
271+
272272
info.GetReturnValue().Set(Nan::New(1));
273-
}
274-
else
273+
}
274+
else
275275
{
276276
return Nan::ThrowError("Invalid number of arguments.");
277277
}
278278
}
279279
/*
280-
_ __ _ _
280+
_ __ _ _
281281
| |/ /___ _ _| |__ ___ __ _ _ __ __| |
282282
| ' // _ \ | | | '_ \ / _ \ / _` | '__/ _` |
283283
| . \ __/ |_| | |_) | (_) | (_| | | | (_| |
284284
|_|\_\___|\__, |_.__/ \___/ \__,_|_| \__,_|
285-
|___/
285+
|___/
286286
*/
287-
struct KeyNames
287+
struct KeyNames
288288
{
289289
const char* name;
290290
MMKeyCode key;
@@ -324,7 +324,7 @@ static KeyNames key_names[] =
324324
{ "space", K_SPACE },
325325
{ "printscreen", K_PRINTSCREEN },
326326
{ "insert", K_INSERT },
327-
327+
328328
{ "audio_mute", K_AUDIO_VOLUME_MUTE },
329329
{ "audio_vol_down", K_AUDIO_VOLUME_DOWN },
330330
{ "audio_vol_up", K_AUDIO_VOLUME_UP },
@@ -337,7 +337,7 @@ static KeyNames key_names[] =
337337
{ "audio_forward", K_AUDIO_FORWARD },
338338
{ "audio_repeat", K_AUDIO_REPEAT },
339339
{ "audio_random", K_AUDIO_RANDOM },
340-
340+
341341
{ "lights_mon_up", K_LIGHTS_MON_UP },
342342
{ "lights_mon_down", K_LIGHTS_MON_DOWN },
343343
{ "lights_kbd_toggle",K_LIGHTS_KBD_TOGGLE },
@@ -360,7 +360,7 @@ int CheckKeyCodes(char* k, MMKeyCode *key)
360360
*key = K_NOT_A_KEY;
361361

362362
KeyNames* kn = key_names;
363-
while (kn->name)
363+
while (kn->name)
364364
{
365365
if (strcmp(k, kn->name) == 0)
366366
{
@@ -370,7 +370,7 @@ int CheckKeyCodes(char* k, MMKeyCode *key)
370370
kn++;
371371
}
372372

373-
if (*key == K_NOT_A_KEY)
373+
if (*key == K_NOT_A_KEY)
374374
{
375375
return -2;
376376
}
@@ -578,9 +578,9 @@ NAN_METHOD(typeStringDelayed)
578578
{
579579
char *str;
580580
Nan::Utf8String string(info[0]);
581-
581+
582582
str = *string;
583-
583+
584584
size_t cpm = info[1]->Int32Value();
585585

586586
typeStringDelayed(str, cpm);
@@ -601,12 +601,12 @@ NAN_METHOD(setKeyboardDelay)
601601
}
602602

603603
/*
604-
____
605-
/ ___| ___ _ __ ___ ___ _ __
606-
\___ \ / __| '__/ _ \/ _ \ '_ \
604+
____
605+
/ ___| ___ _ __ ___ ___ _ __
606+
\___ \ / __| '__/ _ \/ _ \ '_ \
607607
___) | (__| | | __/ __/ | | |
608608
|____/ \___|_| \___|\___|_| |_|
609-
609+
610610
*/
611611

612612
/**
@@ -627,7 +627,7 @@ NAN_METHOD(getPixelColor)
627627
{
628628
return Nan::ThrowError("Invalid number of arguments.");
629629
}
630-
630+
631631
MMBitmapRef bitmap;
632632
MMRGBHex color;
633633

@@ -642,9 +642,9 @@ NAN_METHOD(getPixelColor)
642642
bitmap = copyMMBitmapFromDisplayInRect(MMRectMake(x, y, 1, 1));
643643

644644
color = MMRGBHexAtPoint(bitmap, 0, 0);
645-
645+
646646
char hex[7];
647-
647+
648648
padHex(color, hex);
649649

650650
destroyMMBitmap(bitmap);
@@ -666,18 +666,18 @@ NAN_METHOD(getScreenSize)
666666
info.GetReturnValue().Set(obj);
667667
}
668668

669-
NAN_METHOD(captureScreen)
669+
NAN_METHOD(captureScreen)
670670
{
671671
size_t x;
672672
size_t y;
673673
size_t w;
674674
size_t h;
675-
676-
//If user has provided screen coords, use them!
675+
676+
//If user has provided screen coords, use them!
677677
if (info.Length() == 4)
678678
{
679679
//TODO: Make sure requested coords are within the screen bounds, or we get a seg fault.
680-
// An error message is much nicer!
680+
// An error message is much nicer!
681681

682682
x = info[0]->Int32Value();
683683
y = info[1]->Int32Value();
@@ -689,15 +689,15 @@ NAN_METHOD(captureScreen)
689689
//We're getting the full screen.
690690
x = 0;
691691
y = 0;
692-
692+
693693
//Get screen size.
694694
MMSize displaySize = getMainDisplaySize();
695695
w = displaySize.width;
696696
h = displaySize.height;
697697
}
698-
698+
699699
MMBitmapRef bitmap = copyMMBitmapFromDisplayInRect(MMRectMake(x, y, w, h));
700-
700+
701701
uint32_t bufferSize = bitmap->bytewidth * bitmap->height;
702702
Local<Object> buffer = Nan::NewBuffer((char*)bitmap->imageBuffer, bufferSize, destroyMMBitmapBuffer, NULL).ToLocalChecked();
703703

@@ -708,17 +708,17 @@ NAN_METHOD(captureScreen)
708708
Nan::Set(obj, Nan::New("bitsPerPixel").ToLocalChecked(), Nan::New<Number>(bitmap->bitsPerPixel));
709709
Nan::Set(obj, Nan::New("bytesPerPixel").ToLocalChecked(), Nan::New<Number>(bitmap->bytesPerPixel));
710710
Nan::Set(obj, Nan::New("image").ToLocalChecked(), buffer);
711-
711+
712712
info.GetReturnValue().Set(obj);
713713
}
714714

715715
/*
716-
____ _ _
717-
| __ )(_) |_ _ __ ___ __ _ _ __
718-
| _ \| | __| '_ ` _ \ / _` | '_ \
716+
____ _ _
717+
| __ )(_) |_ _ __ ___ __ _ _ __
718+
| _ \| | __| '_ ` _ \ / _` | '_ \
719719
| |_) | | |_| | | | | | (_| | |_) |
720-
|____/|_|\__|_| |_| |_|\__,_| .__/
721-
|_|
720+
|____/|_|\__|_| |_| |_|\__,_| .__/
721+
|_|
722722
*/
723723

724724
class BMP
@@ -733,7 +733,7 @@ class BMP
733733
};
734734

735735
//Convert object from Javascript to a C++ class (BMP).
736-
BMP buildBMP(Local<Object> info)
736+
BMP buildBMP(Local<Object> info)
737737
{
738738
Local<Object> obj = Nan::To<v8::Object>(info).ToLocalChecked();
739739

@@ -805,7 +805,7 @@ NAN_MODULE_INIT(InitAll)
805805

806806
Nan::Set(target, Nan::New("mouseToggle").ToLocalChecked(),
807807
Nan::GetFunction(Nan::New<FunctionTemplate>(mouseToggle)).ToLocalChecked());
808-
808+
809809
Nan::Set(target, Nan::New("scrollMouse").ToLocalChecked(),
810810
Nan::GetFunction(Nan::New<FunctionTemplate>(scrollMouse)).ToLocalChecked());
811811

@@ -832,10 +832,10 @@ NAN_MODULE_INIT(InitAll)
832832

833833
Nan::Set(target, Nan::New("getScreenSize").ToLocalChecked(),
834834
Nan::GetFunction(Nan::New<FunctionTemplate>(getScreenSize)).ToLocalChecked());
835-
835+
836836
Nan::Set(target, Nan::New("captureScreen").ToLocalChecked(),
837837
Nan::GetFunction(Nan::New<FunctionTemplate>(captureScreen)).ToLocalChecked());
838-
838+
839839
Nan::Set(target, Nan::New("getColor").ToLocalChecked(),
840840
Nan::GetFunction(Nan::New<FunctionTemplate>(getColor)).ToLocalChecked());
841841
}

0 commit comments

Comments
 (0)