From 5a14759c8cec54edff8a8ec00e600d7d11b49e46 Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Mon, 28 Mar 2016 20:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=99=A4=E7=BC=96=E8=AF=91=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/draw/background.c | 2 +- src/gui/widget_event.c | 3 ++- src/input/keyboard.c | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/draw/background.c b/src/draw/background.c index c378f12d..1f119d68 100644 --- a/src/draw/background.c +++ b/src/draw/background.c @@ -51,7 +51,7 @@ void Background_Init( LCUI_Background *bg ) bg->position.value = SV_AUTO; } -typedef void(*MixerPtr)(LCUI_Graph*, const LCUI_Graph*, int, int); +typedef int(*MixerPtr)(LCUI_Graph*, const LCUI_Graph*, int, int); void Graph_DrawBackground( LCUI_PaintContext paint, const LCUI_Rect *box, LCUI_Background *bg ) diff --git a/src/gui/widget_event.c b/src/gui/widget_event.c index f3adea66..1cd99ba7 100644 --- a/src/gui/widget_event.c +++ b/src/gui/widget_event.c @@ -442,8 +442,9 @@ int Widget_PostSurfaceEvent( LCUI_Widget w, int event_type ) return Widget_PostEvent( root, &e, *((int**)n), NULL ); } -static unsigned int Dict_KeyHash( const wchar_t *buf ) +static unsigned int Dict_KeyHash( const void *key ) { + const char *buf = key; unsigned int hash = 5381; while( *buf ) { hash = ((hash << 5) + hash) + (*buf++); diff --git a/src/input/keyboard.c b/src/input/keyboard.c index 3b467940..a36a4ba9 100755 --- a/src/input/keyboard.c +++ b/src/input/keyboard.c @@ -274,16 +274,15 @@ int LCUIKeyboard_GetKey( void ) #ifdef LCUI_KEYBOARD_DRIVER_LINUX static LCUI_BOOL LCUIKeyboard_Proc(void) { - LCUI_SysEvent e; + LCUI_SysEventRec e; /* 如果没有按键输入 */ if ( !LCUIKeyboard_IsHit() ) { return FALSE; } e.type = LCUI_KEYDOWN; - e.type_name = NULL; e.key_code = LCUIKeyboard_GetKey(); - LCUI_PostEvent( &e ); + LCUI_TriggerEvent( &e ); return TRUE; } #endif