From ad3eb77af098f34c1ea8cb50f468a8b75fb7d61c Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 27 Sep 2026 15:03:45 +0100 Subject: Take keyboards, mice and touch screens on the display (evdev) vega display --live reads the kernel's input events with no library: keys become Pure's key names and the text they type on a US layout, going through the TUI's own handling (the input line takes text, else the app takes keys); a mouse moves an outlined pointer and clicks, a touch screen presses where it is touched, scaled from the device's range; the line pressed is the row. --input FILE reads recorded events to their end and prints the last frame, which is how this screenless Pi checks it: after typing two items with Shift, Enter, Tab, Space and a touch on a row, the display's last frame is the TUI's after the same keys and click, and came back from the display controller as drawn. --- docs/design/003-pixel-surface.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/design/003-pixel-surface.md b/docs/design/003-pixel-surface.md index 9d9f2b1..725f3b1 100644 --- a/docs/design/003-pixel-surface.md +++ b/docs/design/003-pixel-surface.md @@ -41,9 +41,22 @@ PPM 쓰기)가 7 ms다. 192×45칸(1920×1350)은 프레임마다 12 ms다(그 프레임 하나가 20.6 ms다(합성, 복사, 커밋과 수직 동기 한 번(60 Hz, 16.7 ms), 캡처를 읽어 대 보고 6 MB PPM을 쓰기까지). 돌아온 그림은 늘 그린 것과 같았다(다른 픽셀 0). +## 입력(evdev) + +`--live`는 스크립트 대신 사람의 입력을 받는다(`surfaces/input.c`, 라이브러리 없이 커널의 입력 사건을 읽는다). 키보드는 Pure의 키 +이름(`KeyboardEvent.code`의 철자)과 US 배열에서 그 키가 치는 글자가 되고, TUI가 쓰는 것과 같은 처리(`handle_key`, +`handle_text`: 입력 줄이면 글이, 아니면 키가 된다)로 간다. 마우스는 움직임과 왼쪽 단추와 휠이, 터치 화면은 장치의 범위를 화면에 +맞춘 위치와 누름이 된다. 누른 픽셀의 줄이 곧 행이다(`vega_hit`). 마우스 포인터는 그 아래 칸의 테두리로 보인다. 신호(SIGINT, +SIGTERM)에서 멈춘다. + +`--input FILE`은 파일에 기록된 사건(`struct input_event`, 위치는 화면 픽셀)을 끝까지 읽고 마지막 프레임을 글로 낸다. 화면도 +키보드도 없는 Pi에서 이 경로로 확인한다(`/dev/uinput`은 root만 쓴다). + ## 확인 -`tests/check.py` 11번과 12번. 12번은 writeback 커넥터가 있으면 같은 스크립트를 디스플레이로 돌린다. 프레임마다 돌아온 그림이 +`tests/check.py` 11번과 12번. 12번의 둘째 부분은 기록된 사건(Shift로 대문자를 치고 Enter, Tab, Space, 첫 항목 행을 터치)으로 +디스플레이를 돌린다. 마지막 프레임이 같은 키와 클릭을 받은 TUI의 프레임과 줄마다 같고, writeback으로 돌아온 그림이 그린 것과 +같다(사건 62개). 12번은 writeback 커넥터가 있으면 같은 스크립트를 디스플레이로 돌린다. 프레임마다 돌아온 그림이 그린 것과 같고, 같은 격자의 픽셀 표면 그림과 픽셀 하나까지 같다(640×480에서 프레임 둘, 589,512 픽셀). `tests/check.py` 11번. 같은 스크립트를 `tui --dump`와 `pixels`로 돌려 글이 같고, 그림에서 빈 칸은 그 행의 배경(포커스 행은 제 @@ -52,5 +65,5 @@ PPM 쓰기)가 7 ms다. 192×45칸(1920×1350)은 프레임마다 12 ms다(그 ## 다음 - 바뀐 칸만 다시 그리고 복사한다(TUI가 이미 칸마다 보인 것을 기억한다). 커밋을 기다리지 않고 페이지 넘김 이벤트로 맞춘다. -- 입력: evdev(키보드, 마우스, 터치). 칸의 격자가 있으니 클릭이 곧 행이다(`vega_hit`). +- 입력: 한글 입력기(지금은 US 배열의 글자만 친다), 제스처(끌기로 스크롤). - 비례 글꼴의 줄: 칸이 아닌 글자 폭으로 놓는 표와 문단. 합성은 GPU로(아틀라스, [002](002-symbol-format.md)). -- cgit v1.2.3