From 15f54b48fa4724c0f0632cf3d16233d9e4f52bc2 Mon Sep 17 00:00:00 2001 From: He4eT Date: Mon, 19 Jul 2021 00:44:13 +0500 Subject: [PATCH] Update README.md --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b485cc2..c06fff0 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,18 @@ const { glkInterface, sendFn } = ### Input ```js -sendFn('open door', windowObject) +sendFn('open door', inputType, targetWindow) ``` -You can received `windowObject` in `onUpdateWindows` handler.
-You should respect input type setted by `onUpdateInputs`. +You can receive `inputType` and `id` of `targetWindow` in `onUpdateInputs` handler.
+You can receive `targetWindow` by its `is` in `onUpdateWindows` handler.
+As I know, `inputType` can be `line` or `char`. ### Output and lifecycle ```js const handlers = { onInit: () => { /** - * It's time to prepare the user interface. + * It's time to initialize the user interface. */ }, onUpdateWindows: windows => { @@ -35,10 +36,11 @@ const handlers = { * Game wants to change the number of windows. */ }, - onUpdateInputs: type => { + onUpdateInputs: data => { /** * Game wants to change input type. - * Supported types: 'char', 'line'. + * 'data' is a list with info about + * the target window and the input type. */ }, onUpdateContent: messages => {