~rabbits/orca-toy

12c3aaca2affe5cf6853021b347f63bf82ca3f75 — neauoire 1 year, 5 months ago 06627bb
Implemented cursor controls via stdin
2 files changed, 26 insertions(+), 5 deletions(-)

M README.md
M src/main.tal
M README.md => README.md +9 -0
@@ 60,6 60,15 @@ To display the list of operators inside of Orca, use `CmdOrCtrl+G`.
- `;` **note**(octave note): Sends a single note.
- `/` **byte**(hb lb): Sends a single byte.

#### Advanced

Orca listens to stdin events and inputs the byte values as keyboard inputs. The cursor can also be moved with special bytes:

- `#11` **up**
- `#12` **down**
- `#13` **left**
- `#14` **right**

## Controls

- `arrow` move

M src/main.tal => src/main.tal +17 -5
@@ 236,11 236,23 @@ BRK

@on-console ( -> )

	.Console/read DEI IS-CHAR-KEY ,&continue JCN
		BRK
		&continue

	.selection LDZ2 .Console/read DEI SET-CELL 
	.Console/read DEI
	DUP #11 ! ,&no-up JCN
		#00ff #00 ;edit-selection JSR2
		&no-up
	DUP #12 ! ,&no-down JCN
		#0001 #00 ;edit-selection JSR2
		&no-down
	DUP #13 ! ,&no-left JCN
		#ff00 #00 ;edit-selection JSR2
		&no-left
	DUP #14 ! ,&no-right JCN
		#0001 #00 ;edit-selection JSR2
		&no-right
	DUP IS-CHAR-KEY #00 = ,&no-key JCN
		STHk .selection LDZ2 STHr SET-CELL 
		&no-key
	POP

BRK