This commit is contained in:
Vincent Wei
2019-06-16 17:35:15 +08:00
parent 57d8eb5237
commit 421ffea9c5
2 changed files with 50 additions and 16 deletions
+2 -2
View File
@@ -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;
}
+48 -14
View File
@@ -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 <http://www.gnu.org/licenses/>.
*
*
* 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
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
/*
** 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:
**
** <event-type>[-<event-type>]*
**
** The <event-type> 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 <stdio.h>
@@ -120,7 +154,7 @@ static int event_generator (void)
int event_type;
int retvalue;
static int last_down_key;
while (1) {
retvalue = 0;