📄 gui_onkey.lst
字号:
C51 COMPILER V8.05a GUI_ONKEY 04/11/2008 14:18:46 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE GUI_ONKEY
OBJECT MODULE PLACED IN GUI_OnKey.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\Core\GUI_OnKey.c LARGE BROWSE MDU_F120 DEBUG OBJECTEXTEND
- PRINT(.\GUI_OnKey.lst) OBJECT(GUI_OnKey.obj)
line level source
1 /*
2 *********************************************************************************************************
3 * uC/GUI
4 * Universal graphic software for embedded applications
5 *
6 * (c) Copyright 2002, Micrium Inc., Weston, FL
7 * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
8 *
9 * 礐/GUI is protected by international copyright laws. Knowledge of the
10 * source code may not be used to write a similar product. This file may
11 * only be used in accordance with a license and should not be redistributed
12 * in any way. We appreciate your understanding and fairness.
13 *
14 ----------------------------------------------------------------------
15 File : GUI_OnKey.c
16 Purpose : Implementation of GUI_StoreKeyMsg
17 ---------------------------END-OF-HEADER------------------------------
18 */
19
20
21 #include "gui\Core\GUI_Protected.h"
22
23 static int _Key;
24 static int _KeyMsgCnt;
25 static struct {
26 int Key;
27 int PressedCnt;
28 } _KeyMsg;
29
30 GUI_KEY_MSG_HOOK* GUI_pfKeyMsgHook;
31
32 /*********************************************************************
33 *
34 * Public code
35 *
36 **********************************************************************
37 */
38
39 /*******************************************************************
40 *
41 * GUI_GetKey
42 */
43
44 int GUI_GetKey(void) {
45 1 int r = _Key;
46 1 _Key = 0;
47 1 return r;
48 1 }
49
50 /*******************************************************************
51 *
52 * GUI_StoreKey
53 */
54
C51 COMPILER V8.05a GUI_ONKEY 04/11/2008 14:18:46 PAGE 2
55 void GUI_StoreKey(int Key) {
56 1 if (!_Key)
57 1 _Key = Key;
58 1 }
59
60 /*******************************************************************
61 *
62 * GUI_ClearKeyBuffer
63 */
64
65 void GUI_ClearKeyBuffer(void) {
66 1 while (GUI_GetKey());
67 1 }
68
69 /*********************************************************************
70 *
71 * GUI_StoreKeyMsg
72 */
73 void GUI_StoreKeyMsg(int Key, int PressedCnt) {
74 1 #if GUI_WINSUPPORT /* If 0, WM will not generate any code */
_KeyMsg.Key = Key;
_KeyMsg.PressedCnt = PressedCnt;
_KeyMsgCnt = 1;
#else
79 1 GUI_USE_PARA(PressedCnt);
80 1 GUI_StoreKey(Key);
81 1 #endif
82 1 }
83
84 /*********************************************************************
85 *
86 * GUI_PollKeyMsg
87 */
88 #if GUI_WINSUPPORT /* If 0, WM will not generate any code */
int GUI_PollKeyMsg(void) {
int r = 0;
if (_KeyMsgCnt) {
int Key;
Key = _KeyMsg.Key;
#if 0
if (WM_OnKey(Key, _KeyMsg.PressedCnt) == 0) {
if (_KeyMsg.PressedCnt == 1) {
GUI_StoreKey(Key);
}
}
#else
WM_OnKey(Key, _KeyMsg.PressedCnt);
if (_KeyMsg.PressedCnt == 1) {
GUI_StoreKey(Key);
}
#endif
_KeyMsgCnt--;
r = 1; /* We have done something */
}
return r;
}
#endif
112
113 /*********************************************************************
114 *
115 * GUI_SendKeyMsg
116 *
C51 COMPILER V8.05a GUI_ONKEY 04/11/2008 14:18:46 PAGE 3
117 * Purpose:
118 * Send the key to a window using the window manager (if available).
119 * If no window is ready to take the input, we call the store routine
120 * and wait for somebody to poll the buffer.
121 */
122 void GUI_SendKeyMsg(int Key, int PressedCnt) {
123 1 #if GUI_WINSUPPORT /* If 0, WM will not generate any code */
if (!WM_OnKey(Key, PressedCnt)) {
GUI_StoreKeyMsg(Key, PressedCnt);
}
#else
128 1 GUI_StoreKeyMsg(Key, PressedCnt);
129 1 #endif
130 1 }
131
132
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 49 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 10 ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -