Skip to content

Commit

Permalink
fix keys again, more power key combinatios
Browse files Browse the repository at this point in the history
ilyakurdyukov authored Dec 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 2d97d4d commit 1ffaf36
Showing 4 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -90,6 +90,9 @@ All feature phone LCDs I've seen are vertical, if you have a phone with a horizo
| Power + Up | run on/off |
| Power + Down | open/close menu |
| Power + L/R | prev/next weapon |
| Power + LSoft | zoom in |
| Power + RSoft | zoom out |
| Power + Dial | map |

* D-pad and keys 1-9 are rotated with the `--rotate` option (with screen or separately).
* For phones without D-pad Center key (Nobby 170B) - up/down keys are used for fire.
6 changes: 6 additions & 0 deletions fpbuild/fp_layer.c
Original file line number Diff line number Diff line change
@@ -114,6 +114,8 @@ enum { KEYPAD_ENUM(X) };
enum {
#define X(num, name) KEY_##name = num,
X(0x01, ESCAPE)
X(0x0c, MINUS)
X(0x0d, EQUALS)
X(0x0f, TAB)
X(0x1a, LBRACKET)
X(0x1b, RBRACKET)
@@ -166,6 +168,10 @@ void keytrn_init(void) {
KEY(RIGHT, KEY_APOSTROPHE)
KEY(DOWN, KEY_ESCAPE)
KEY(CENTER, KEY_ENTER)

KEY(LSOFT, KEY_EQUALS)
KEY(RSOFT, KEY_MINUS)
KEY(DIAL, KEY_TAB) /* map */
#undef KEY
};
int i, flags = sys_getkeymap(keymap);
4 changes: 4 additions & 0 deletions fpdoom/keytrn.c
Original file line number Diff line number Diff line change
@@ -35,6 +35,10 @@ void keytrn_init(void) {
KEY(RIGHT, ']')
KEY(DOWN, KEY_ESCAPE)
KEY(CENTER, KEY_ENTER)

KEY(LSOFT, KEY_EQUALS)
KEY(RSOFT, KEY_MINUS)
KEY(DIAL, KEY_TAB) /* map */
#undef KEY
};
int i, flags = sys_getkeymap(keymap);
8 changes: 3 additions & 5 deletions fpdoom/syscode.c
Original file line number Diff line number Diff line change
@@ -779,11 +779,9 @@ static void keypad_init(void) {
short *keymap = sys_data.keymap_addr;
int i, j, row = 0, col = 0, ctrl;
int nrow = _chip != 1 ? 8 : 5;
#if 0 // Usually col < 5 for SC6531DA.
int ncol = _chip != 1 ? 5 : 8;
#else // But the Children's Camera has UP at i=6, j=3.
int ncol = sys_data.keycols;
#endif
// Usually ncol = 5 for SC6531DA.
// But the Children's Camera has UP at i=6, j=3.
int ncol = _chip != 1 ? sys_data.keycols : 8;

for (i = 0; i < ncol; i++)
for (j = 0; j < nrow; j++)

0 comments on commit 1ffaf36

Please sign in to comment.