forked from Ryuzaki-MrL/savemii
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
406 additions
and
75 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
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,31 @@ | ||
#pragma once | ||
|
||
#include <ApplicationState.h> | ||
#include <memory> | ||
#include <utils/InputUtils.h> | ||
#include <utils/KeyboardUtils.h> | ||
|
||
class KeyboardState : public ApplicationState { | ||
public: | ||
KeyboardState(std::string & input) : input(input) { | ||
this->keyboard = std::make_unique<Keyboard>(); | ||
} | ||
enum eState { | ||
STATE_KEYBOARD, | ||
STATE_DO_SUBSTATE, | ||
}; | ||
|
||
void render() override; | ||
ApplicationState::eSubState update(Input *input) override; | ||
|
||
private: | ||
std::unique_ptr<ApplicationState> subState{}; | ||
eState state = STATE_KEYBOARD; | ||
|
||
std::unique_ptr<Keyboard> keyboard; | ||
|
||
int entrycount = 4; | ||
int cursorPosX = 0; | ||
int cursorPosY = 0; | ||
std::string & input; | ||
}; |
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,41 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
class Keyboard { | ||
public: | ||
friend class KeyboardState; | ||
void render(); | ||
int kbLeft(); | ||
int kbRight(); | ||
int kbUp(); | ||
int kbDown(); | ||
void kbKeyPressed(); | ||
void shiftPressed(); | ||
void delPressed(); | ||
std::string input; | ||
Keyboard() : row(2),column(5) { | ||
keysNormal = {"`1234567890-=", | ||
"qwertyuiop[]|", | ||
"asdfghjkl;' ", | ||
"zxcvbnm ,./ "}; | ||
keysShift = { "~!@#$%^&*()_+", | ||
"QWERTYUIOP{}\\", | ||
"ASDFGHJKL:\" ", | ||
"ZXCVBNM <> "}; | ||
currentKeyboard = keysNormal; | ||
setCurrentKey(); | ||
} | ||
void setCurrentKey() { currentKey = currentKeyboard[row].substr(column,1); } | ||
private: | ||
std::vector<std::string> keysNormal; | ||
std::vector<std::string> keysShift; | ||
std::vector<std::string> currentKeyboard; | ||
std::string prevKeys; | ||
std::string currentKey; | ||
std::string nextKeys; | ||
int row; | ||
int column; | ||
|
||
}; |
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
Oops, something went wrong.