Skip to content

Commit

Permalink
use F1 to open README
Browse files Browse the repository at this point in the history
  • Loading branch information
black-sliver committed Jan 3, 2024
1 parent 902dbf7 commit a62a405
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Check [OUTLINE.md](OUTLINE.md) to get an overview of everything.
- build with `-D_FORTIFY_SOURCE=2`, `-pie`, ASLR, RELRO ?
- fuzz lua and json interfaces

## Docs
- compile README to HTML and open local copy with F1

## WASM
- custom html, to only have canvas. Use js console for stdout and stderr
- sync sdl window with html canvas (size)
Expand Down
8 changes: 8 additions & 0 deletions src/poptracker.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "poptracker.h"
#include <luaglue/lua_include.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "ui/trackerwindow.h"
#include "ui/broadcastwindow.h"
Expand Down Expand Up @@ -32,6 +33,7 @@ enum HotkeyID {
HOTKEY_FORCE_RELOAD,
HOTKEY_TOGGLE_SPLIT_COLORS,
HOTKEY_SHOW_BROADCAST,
HOTKEY_SHOW_HELP,
};


Expand Down Expand Up @@ -314,6 +316,11 @@ bool PopTracker::start()
else if (hotkey.id == HOTKEY_SHOW_BROADCAST) {
showBroadcast();
}
else if (hotkey.id == HOTKEY_SHOW_HELP) {
if (SDL_OpenURL("https://github.com/black-sliver/PopTracker/blob/master/README.md") != 0) {
Dlg::MsgBox("Error", SDL_GetError(), Dlg::Buttons::OK, Dlg::Icon::Error);
}
}
}};
_ui->addHotkey({HOTKEY_TOGGLE_VISIBILITY, SDLK_F11, KMOD_NONE});
_ui->addHotkey({HOTKEY_TOGGLE_VISIBILITY, SDLK_h, KMOD_LCTRL});
Expand All @@ -328,6 +335,7 @@ bool PopTracker::start()
_ui->addHotkey({HOTKEY_TOGGLE_SPLIT_COLORS, SDLK_p, KMOD_LCTRL});
_ui->addHotkey({HOTKEY_TOGGLE_SPLIT_COLORS, SDLK_p, KMOD_RCTRL});
_ui->addHotkey({HOTKEY_SHOW_BROADCAST, SDLK_F2, KMOD_NONE});
_ui->addHotkey({HOTKEY_SHOW_HELP, SDLK_F1, KMOD_NONE});

// restore state from config
if (_config.type() == json::value_t::object) {
Expand Down

0 comments on commit a62a405

Please sign in to comment.