-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #238-key-improvements * rework tests, cleanup, improve handling * Improve doc generation
- Loading branch information
Showing
55 changed files
with
810 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
#!/bin/sh | ||
# Update scripting: | ||
echo "# Select a printer to view scripting options:" > Scripting.md | ||
for i in Scripting_*.md; do | ||
for i in Scripting-*.md; do | ||
TMP=`basename $i .md`; | ||
echo "- [${TMP}](${TMP})" >> Scripting.md | ||
done | ||
|
||
# Update trace: | ||
echo "# Select a printer to view trace options:" > TraceOptions.md | ||
for i in TraceOptions_*.md; do | ||
echo "# Select a printer to view trace options:" > Trace-Options.md | ||
for i in Trace-Options-*.md; do | ||
TMP=`basename $i .md`; | ||
echo "- [${TMP}](${TMP})" >> TraceOptions.md | ||
echo "- [${TMP}](${TMP})" >> Trace-Options.md | ||
done | ||
|
||
# Update trace: | ||
echo "# Select a printer to view keyboard controls:" > Key-Controls.md | ||
for i in Key-Controls-*.md; do | ||
TMP=`basename $i .md`; | ||
echo "- [${TMP}](${TMP})" >> Key-Controls.md | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
IKeyClient.cpp - Mixin interface class for components/objects that have | ||
key actions. To use, mix in this class and call AddKeyControl() | ||
for each key you wish to get notified of. Multiple handlers can | ||
act on the same key by design. | ||
Copyright 2020 VintagePC <https://github.com/vintagepc/> | ||
This file is part of MK404. | ||
MK404 is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
MK404 is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with MK404. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "IKeyClient.h" | ||
#include "KeyController.h" | ||
#include <string> | ||
|
||
|
||
void IKeyClient::RegisterKeyHandler(const Key uiKey, const std::string &strDesc) | ||
{ | ||
KeyController::GetController().AddKeyClient(this, uiKey, strDesc); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
IKeyClient.h - Mixin interface class for components/objects that have | ||
key actions. To use, mix in this class and call AddKeyControl() | ||
for each key you wish to get notified of. Multiple handlers can | ||
act on the same key by design. | ||
Copyright 2020 VintagePC <https://github.com/vintagepc/> | ||
This file is part of MK404. | ||
MK404 is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
MK404 is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with MK404. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
class KeyController; | ||
|
||
using Key = unsigned char; | ||
|
||
|
||
class IKeyClient | ||
{ | ||
friend KeyController; | ||
|
||
protected: | ||
virtual void OnKeyPress(const Key &uiKey) = 0; | ||
|
||
void RegisterKeyHandler(const Key uiKey, const std::string &strDesc); | ||
}; |
Oops, something went wrong.