-
Notifications
You must be signed in to change notification settings - Fork 323
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
* Re-implement input history #602 * Fix formatting * Installation header in docs * Check if display is enabled * Fixing input - symbol mapping * Attaching history addon only if available
- Loading branch information
1 parent
85c3915
commit ebd93ba
Showing
18 changed files
with
510 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#ifndef INPUT_HISTORY_H_ | ||
#define INPUT_HISTORY_H_ | ||
|
||
#include "OneBitDisplay.h" | ||
|
||
#include <vector> | ||
#include <string> | ||
#include "gpaddon.h" | ||
#include <deque> | ||
#include <array> | ||
|
||
#ifndef INPUT_HISTORY_ENABLED | ||
#define INPUT_HISTORY_ENABLED 0 | ||
#endif | ||
|
||
#ifndef INPUT_HISTORY_LENGTH | ||
#define INPUT_HISTORY_LENGTH 21 | ||
#endif | ||
|
||
#ifndef INPUT_HISTORY_COL | ||
#define INPUT_HISTORY_COL 0 | ||
#endif | ||
|
||
#ifndef INPUT_HISTORY_ROW | ||
#define INPUT_HISTORY_ROW 7 | ||
#endif | ||
|
||
#define InputHistoryName "InputHistory" | ||
|
||
class InputHistoryAddon : public GPAddon | ||
{ | ||
public: | ||
virtual bool available(); | ||
virtual void setup(); | ||
virtual void preprocess() {} | ||
virtual void process(); | ||
virtual std::string name() { return InputHistoryName; } | ||
virtual void drawHistory(OBDISP *pOBD); | ||
private: | ||
uint32_t historyLength; | ||
uint32_t col; | ||
uint32_t row; | ||
std::string historyString; | ||
std::deque<std::string> inputHistory; | ||
std::array<bool, 18> lastInput; | ||
Gamepad* gamepad; | ||
Gamepad* pGamepad; | ||
bool pressedUp(); | ||
bool pressedDown(); | ||
bool pressedLeft(); | ||
bool pressedRight(); | ||
}; | ||
|
||
#endif |
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,55 @@ | ||
--- | ||
title: Input History | ||
# tags: | ||
# - | ||
pagination_next: null | ||
pagination_prev: null | ||
description: "Add-on to show input history" | ||
--- | ||
|
||
# Input History | ||
|
||
Purpose: This add-on is intended to allow you to display input history | ||
|
||
![GP2040-CE Configurator - Add-Ons Input History](../assets/images/gpc-add-ons-input-history.png) | ||
|
||
## Web Configurator Options | ||
|
||
- `History Length` - Set the max character length of the history. | ||
- `Column` - Specify the column at which the history begins on the display. ( 0 - left, 20 - right ) | ||
- `Row` - Specify the row on which the history appears on the display. ( 0 - top, 7 - bottom ) | ||
|
||
## Hardware | ||
|
||
### Requirements | ||
|
||
An already configured [monochrome display](../web-configurator/menu-pages/07-display-configuration.mdx). | ||
|
||
### Installation | ||
|
||
None. | ||
|
||
## Miscellaneous Notes | ||
|
||
Input - Symbol mapping: | ||
|
||
| GP2040-CE | PS3 | Switch | XINPUT | KEYBOARD | PS4 | CONFIG | | ||
|-----------|:---:|:------:|:------:|:--------:|:---:|:------:| | ||
| Up | U | U | U | U | U | U | | ||
| Down | D | D | D | D | D | D | | ||
| Left | L | L | L | L | L | L | | ||
| Right | R | R | R | R | R | R | | ||
| B1 | X | B | A | B1 | X | B1 | | ||
| B2 | O | A | B | B2 | O | B2 | | ||
| B3 | # | Y | X | B3 | # | B3 | | ||
| B4 | ^ | X | Y | B4 | ^ | B4 | | ||
| L1 | L1 | L | LB | L1 | L1 | L1 | | ||
| R1 | R1 | R | RB | R1 | R1 | R1 | | ||
| L2 | L2 | ZL | LT | L2 | L2 | L2 | | ||
| R2 | R2 | ZR | RT | R2 | R2 | R2 | | ||
| S1 | SL | - | BK | S1 | SH | S1 | | ||
| S2 | ST | + | ST | S2 | OP | S2 | | ||
| L3 | L3 | LS | LS | L3 | L3 | L3 | | ||
| R3 | R3 | RS | RS | R3 | R3 | R3 | | ||
| A1 | PS | H | G | A1 | PS | A1 | | ||
| A2 | A2 | C | A2 | A2 | T | A2 | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.