From 421ffea9c5b22c12d7280bd032f9fe56d14419f4 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Sun, 16 Jun 2019 17:35:15 +0800 Subject: [PATCH] tune --- src/ial/ial.c | 4 ++-- src/ial/random.c | 62 +++++++++++++++++++++++++++++++++++++----------- 2 files changed, 50 insertions(+), 16 deletions(-) diff --git a/src/ial/ial.c b/src/ial/ial.c index 51666dae..13e2c62d 100644 --- a/src/ial/ial.c +++ b/src/ial/ial.c @@ -282,13 +282,13 @@ int mg_InitIAL (void) //strcpy (__mg_cur_input->mdev, mdev); if (!IAL_InitInput (__mg_cur_input, mdev, mtype)) { - _ERR_PRINTF ("IAL: Init IAL engine failure.\n"); + _ERR_PRINTF ("IAL: Failed to initialize the IAL engine: %s.\n", __mg_cur_input->id); return ERR_INPUT_ENGINE; } _DBG_PRINTF ("IAL: Use %s engine.\n", __mg_cur_input->id); - IAL_SetMouseRange (0, 0, WIDTHOFPHYGC - 1, HEIGHTOFPHYGC - 1); + return 0; } diff --git a/src/ial/random.c b/src/ial/random.c index b3097e01..fe8ab6db 100644 --- a/src/ial/random.c +++ b/src/ial/random.c @@ -1,40 +1,74 @@ /* - * This file is part of MiniGUI, a mature cross-platform windowing + * This file is part of MiniGUI, a mature cross-platform windowing * and Graphics User Interface (GUI) support system for embedded systems * and smart IoT devices. - * - * Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd. + * + * Copyright (C) 2002~2019, Beijing FMSoft Technologies Co., Ltd. * Copyright (C) 1998~2002, WEI Yongming - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * * Or, - * + * * As this program is a library, any link to this program must follow * GNU General Public License version 3 (GPLv3). If you cannot accept * GPLv3, you need to be licensed from FMSoft. - * + * * If you have got a commercial license of this program, please use it * under the terms and conditions of the commercial license. - * + * * For more information about the commercial license, please refer to * . */ /* -** random.c: A random IAL Engine -** -** Created by Wei Yongming, 2005/06/08 +** random.c: the random IAL Engine. +** +** Created by WEI Yongming, 2005/06/08 +** +** Enhanced by WEI Yongming to support extra input events in June, 2019. +** +** The MiniGUI runtime configuration key `random.logfile` specifies +** the log file which will store the input events generated by this engine. +** If MiniGUI failed to open the log file, the log feature will be disabled. +** +** The MiniGUI runtime configuration key `random.eventtypes` specifies +** the input event types which will be generated by this IAL engine, +** in the following pattern: +** +** [-]* +** +** The can be one of the following values: +** +** - mouse: mouse. +** - keyboard: keyboard. +** - joystick: joystick buttons. +** - button: buttons other than joystick. +** - single_touch: touch pen or single touch panel. +** - multi_touch: multiple touch panel. +** - gesture: gesture. +** - tablet_tool: tablet tool. +** - tablet_pad: tablet pad. +** - switch: switch. +** +** The MiniGUI ETC key `random.maxkeycode` specify the maximal key code +** which can be generated by the engine. +** +** For invalid `random.eventtyps` and `random.maxkeycord key value, +** use `mouse` and `NR_KEYS` respectively. +** +** This engine maintains a state machine for input events, and +** generates a reasonable event sequence for each event type. */ #include @@ -120,7 +154,7 @@ static int event_generator (void) int event_type; int retvalue; static int last_down_key; - + while (1) { retvalue = 0;