Skip to content

Commit c17c9e9

Browse files
committed
Code formatting
1 parent 2058b31 commit c17c9e9

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

src/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ CFLAGS=-std=c99 -O3 -DWINVER=0x500 -DWIN32_WINNT=0x500
66
LDFLAGS+=-mwindows
77
OBJECTS=main.o trayicon.o resources.o
88
ifdef DEBUG
9-
CFLAGS+= -g
10-
LDFLAGS:=$(filter-out -mwindows, $(LDFLAGS))
9+
CFLAGS+= -g
10+
LDFLAGS:=$(filter-out -mwindows, $(LDFLAGS))
1111
endif
1212

1313
all: neo-llkh.exe
1414

1515
neo-llkh.exe: $(OBJECTS)
16-
$(LD) $(LDFLAGS) -o $@ $^
16+
$(LD) $(LDFLAGS) -o $@ $^
1717

1818
%.o: %.rc
19-
$(WINDRES) -i $^ -o $@
19+
$(WINDRES) -i $^ -o $@
2020

2121
clean:
22-
@rm -f $(OBJECTS) neo-llkh.exe
22+
@rm -f $(OBJECTS) neo-llkh.exe

src/main.c

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ HHOOK keyhook = NULL;
1818
*/
1919
bool bypassMode = false;
2020

21-
2221
/**
2322
* Map a key scancode to the char that should be displayed after typing
2423
**/
@@ -128,8 +127,8 @@ bool isMod4(KBDLLHOOKSTRUCT keyInfo)
128127
return keyInfo.vkCode == VK_RMENU || keyInfo.vkCode == VK_CAPITAL; //keyInfo.scanCode == 43 || keyInfo.scanCode == 86;
129128
}
130129

131-
132-
void logKeyEvent(char* desc, KBDLLHOOKSTRUCT keyInfo) {
130+
void logKeyEvent(char *desc, KBDLLHOOKSTRUCT keyInfo)
131+
{
133132
printf("%-10s sc %u vk 0x%x 0x%x %d\n", desc, keyInfo.scanCode, keyInfo.vkCode,
134133
keyInfo.flags, keyInfo.dwExtraInfo);
135134
}
@@ -150,8 +149,8 @@ LRESULT CALLBACK keyevent(int code, WPARAM wparam, LPARAM lparam)
150149
return CallNextHookEx(NULL, code, wparam, lparam);
151150
}
152151

153-
if(bypassMode)
154-
return CallNextHookEx(NULL, code, wparam, lparam);
152+
if (bypassMode)
153+
return CallNextHookEx(NULL, code, wparam, lparam);
155154

156155
if (code == HC_ACTION && (wparam == WM_SYSKEYUP || wparam == WM_KEYUP)) {
157156
logKeyEvent("key up", keyInfo);
@@ -233,18 +232,17 @@ DWORD WINAPI hookThreadMain(void *user)
233232

234233
void exitApplication()
235234
{
236-
trayicon_remove();
237-
PostQuitMessage(0);
235+
trayicon_remove();
236+
PostQuitMessage(0);
238237
}
239238

240-
241239
void toggleBypassMode()
242240
{
243241
bypassMode = !bypassMode;
244242

245243
HINSTANCE hInstance = GetModuleHandle(NULL);
246244
HICON icon;
247-
if(bypassMode)
245+
if (bypassMode)
248246
icon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPICON_DISABLED));
249247
else
250248
icon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPICON));
@@ -253,16 +251,14 @@ void toggleBypassMode()
253251
printf("%i bypass mode \n", bypassMode);
254252
}
255253

256-
257254
int main(int argc, char *argv[])
258255
{
259256
DWORD tid;
260257

261258
HINSTANCE hInstance = GetModuleHandle(NULL);
262-
trayicon_init(LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPICON)), APPNAME);
263-
trayicon_add_item(NULL, &toggleBypassMode);
264-
trayicon_add_item("Exit", &exitApplication);
265-
259+
trayicon_init(LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPICON)), APPNAME);
260+
trayicon_add_item(NULL, &toggleBypassMode);
261+
trayicon_add_item("Exit", &exitApplication);
266262

267263
HANDLE thread = CreateThread(0, 0, hookThreadMain, argv[0], 0, &tid);
268264

src/trayicon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ bool trayicon_init(HICON icon, char tooltip[])
8383
functionptr_array[0] = NULL;
8484
}
8585

86-
bool trayicon_change_icon(HICON newicon) {
86+
bool trayicon_change_icon(HICON newicon)
87+
{
8788

8889
trayicon_data.hIcon = newicon;
8990
Shell_NotifyIcon(NIM_MODIFY, &trayicon_data);

0 commit comments

Comments
 (0)