Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
1.6.0-bacon4
QWERTY keyboard name entry for new projects
* Press A on the project name field to enter QWERTY keyboard mode
* Navigate the on-screen keyboard with D-PAD/arrows
* Press A to input the selected character
* Press B to backspace
* Press L/R to move the text cursor left/right
* Press START or select OK to exit keyboard mode
* All keyboard navigation logic extracted to reusable KeyboardLayout.h utility

1.6.0-bacon2
Interpolate values in tables and phrases
R + B on single-column selection will fill values from lowest to highest
Expand Down
20 changes: 18 additions & 2 deletions docs/wiki/What-is-LittlePiggyTracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,24 @@ After that you can copy additional wavs to the lgptRoot/lgptProject/samples dire

## New project

When creating a new project, use the Random button to generate a random name. Generate a new name with Random or edit it manually selecting characters with A and pressing up/down
Attempting to create a project with the same name in the same location produces a notification that this operation is denied
When creating a new project, you have several options for naming:

**Random Name Generation:**
- Select the "Random" button and press A to generate a random name

**QWERTY Keyboard Entry:**
- Move to the name field and press A to enter QWERTY keyboard mode
- An on-screen keyboard will appear with these controls:
- **D-PAD/Arrows:** Navigate the keyboard
- **A:** Input the selected character
- **B:** Backspace (delete character)
- **L/R:** Move the text cursor left/right within your project name
- **START or OK key:** Exit keyboard mode and return to the dialog
- The keyboard includes:
- Numbers (0-9)
- Uppercase and lowercase letters (A-Z, a-z)
- Special characters (@ | - _ < > ? ,)
- Space bar, backspace, and OK (done) buttons on the bottom row

## Multiple Projects

Expand Down
17 changes: 17 additions & 0 deletions docs/wiki/tips_and_tricks.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Project Naming with QWERTY Keyboard

Since version 1.6.0, you can use an on-screen QWERTY keyboard when creating new projects:

**Quick Tips:**
- Press A on the project name to enter keyboard mode
- The keyboard cursor will jump to the character under your text cursor unless it's a space
- Use L/R shoulder buttons to move through your project name
- Erase with B and exit with Start

**Keyboard Layout:**
The on-screen keyboard is organized like this:
- Numbers
- Uppercase (A-Q + extra characters)
- Lowercase (a-q + extra characters)
- Special [Space] [Erase] [Done]

# Delays and Echoes
## Simulating LSDj's D command

Expand Down
1 change: 1 addition & 0 deletions projects/lgpt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@
<ClInclude Include="..\sources\Application\utils\fixed.h" />
<ClInclude Include="..\sources\Application\utils\HexBuffers.h" />
<ClInclude Include="..\sources\Application\utils\RandomNames.h" />
<ClInclude Include="..\sources\Application\utils\KeyboardLayout.h" />
<ClInclude Include="..\sources\Application\Player\FileEngine.h" />
<ClInclude Include="..\sources\Application\Player\Player.h" />
<ClInclude Include="..\sources\Application\Player\PlayerChannel.h" />
Expand Down
11 changes: 10 additions & 1 deletion projects/lgptest.dev
Original file line number Diff line number Diff line change
Expand Up @@ -2937,7 +2937,6 @@ Priority=1000
OverrideBuildCmd=0
BuildCmd=


[Unit288]
FileName=..\sources\Application\utils\RandomNames.h
CompileCpp=1
Expand All @@ -2948,3 +2947,13 @@ Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit289]
FileName=..\sources\Application\utils\KeyboardLayout.h
CompileCpp=1
Folder=Application/Utils
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

20 changes: 10 additions & 10 deletions sources/Application/Model/Project.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#define PROJECT_NUMBER "1"
#define PROJECT_RELEASE "6"
#define BUILD_COUNT "0-bacon2"
#define BUILD_COUNT "0-bacon4"

#define MAX_TAP 3

Expand Down Expand Up @@ -56,14 +56,14 @@ class Project: public Persistent,public VariableContainer,I_Observer {
void LoadFirstGen(const char *root);

protected:
void buildMidiDeviceList() ;
private:
InstrumentBank *instrumentBank_ ;
char **midiDeviceList_ ;
int midiDeviceListSize_ ;
int tempoNudge_ ;
unsigned long lastTap_[MAX_TAP] ;
unsigned int tempoTapCount_;
} ;
void buildMidiDeviceList();

private:
InstrumentBank *instrumentBank_;
char **midiDeviceList_;
int midiDeviceListSize_;
int tempoNudge_;
unsigned long lastTap_[MAX_TAP];
unsigned int tempoTapCount_;
};
#endif
102 changes: 102 additions & 0 deletions sources/Application/Utils/KeyboardLayout.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#ifndef _KEYBOARD_LAYOUT_H_
#define _KEYBOARD_LAYOUT_H_

#include <cstring>

// Keyboard layout configuration
#define SPACE_ROW 7
#define KEYBOARD_ROWS (SPACE_ROW + 1)

#define SPACE_START 0
#define SPACE_END 3
#define BACK_START 4
#define BACK_END 6
#define DONE_START 8
#define DONE_END 10

static const char* keyboardLayout[] = {
"1234567890",
"QWERTYUIOP",
"ASDFGHJKL@",
"ZXCVBNM,?>",
"qwertyuiop",
"asdfghjkl|",
"zxcvbnm-_<",
"[_] <- OK"
};

// Helper functions for special row section detection
inline bool isInSpaceSection(int col) { return col < SPACE_END; }
inline bool isInBackSection(int col) { return col >= BACK_START && col < BACK_END; }
inline bool isInDoneSection(int col) { return col >= DONE_START; }

// Get the character at a specific keyboard position
inline char getKeyAtPosition(int row, int col) {
if (row < 0 || row >= KEYBOARD_ROWS) return '\0';
const char* rowStr = keyboardLayout[row];

// Handle special row with SPC, BACK, and DONE
if (row == SPACE_ROW) {
if (col >= 0 && col < SPACE_END)
return ' '; // [_] (space)
if (col >= BACK_START && col < BACK_END) return '\b'; // <- (backspace)
if (col >= DONE_START && col < DONE_END) return '\r'; // OK (carriage return)
return '\0';
}

int len = strlen(rowStr);
if (col < 0 || col >= len) return '\0';
return rowStr[col];
}

// Find a character's position in the keyboard layout
inline void findCharacterInKeyboard(char ch, int &outRow, int &outCol) {
if (ch == ' ') return; // Skip space character

// Search for character in keyboard layout (excluding special row)
for (int row = 0; row < SPACE_ROW; row++) {
const char* rowStr = keyboardLayout[row];
int len = strlen(rowStr);
for (int col = 0; col < len; col++) {
if (rowStr[col] == ch) {
outRow = row;
outCol = col;
return;
}
}
}
// Character not found, don't change position
}

// Clamp keyboard column to valid range for current row
inline void clampKeyboardColumn(int row, int& col) {
if (row == SPACE_ROW) {
if (col < SPACE_END) col = SPACE_START;
else if (col <= BACK_END) col = BACK_START;
else col = DONE_START;
} else {
int maxCol = strlen(keyboardLayout[row]) - 1;
if (col > maxCol) col = 0;
}
}

// Cycle keyboard column left (-1) or right (+1) within current row
inline void cycleKeyboardColumn(int row, int direction, int& col) {
if (row == SPACE_ROW) {
if (direction < 0) { // LEFT
if (isInSpaceSection(col))
col = DONE_START;
else if (isInBackSection(col)) col = SPACE_START;
else col = BACK_START;
} else { // RIGHT
if (isInBackSection(col)) col = DONE_START;
else if (isInDoneSection(col)) col = SPACE_START;
else col = BACK_START;
}
} else {
int maxCol = strlen(keyboardLayout[row]) - 1;
col = (col + direction + maxCol + 1) % (maxCol + 1);
}
}

#endif
Loading