CHDK_DE Vorschauversion  Trunk Rev. 5272
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
kbd_process.c-Dateireferenz
#include "camera.h"
#include "conf.h"
#include "keyboard.h"
#include "action_stack.h"
#include "lang.h"
#include "gui.h"
#include "gui_lang.h"
#include "console.h"
#include "usb_remote.h"
#include "clock.h"
#include "debug_led.h"
+ Include-Abhängigkeitsdiagramm für kbd_process.c:

gehe zum Quellcode dieser Datei

Funktionen

long kbd_get_autoclicked_key ()
 
int kbd_is_blocked ()
 
void enter_alt ()
 
void exit_alt ()
 
long kbd_process ()
 

Variablen

static long last_kbd_key = 0
 
static long last_kbd_time = 0
 
static long press_count = 0
 
int kbd_blocked
 

Dokumentation der Funktionen

void enter_alt ( )

Definiert in Zeile 65 der Datei kbd_process.c.

66 {
67  clear_usb_power(); // Prevent previous USB remote pulse from starting script.
68  kbd_blocked = 1;
70 }
void exit_alt ( )

Definiert in Zeile 72 der Datei kbd_process.c.

73 {
74  kbd_blocked = 0;
76 }
long kbd_get_autoclicked_key ( )

Definiert in Zeile 20 der Datei kbd_process.c.

21 {
22  register long key, t;
23 
24  key=kbd_get_clicked_key();
25  if (key && (key != last_kbd_key))
26  {
27  last_kbd_key = key;
28  press_count = 0;
30  return key;
31  }
32  else
33  {
35  {
36  t = get_tick_count();
38  {
39  ++press_count;
40  last_kbd_time = t;
41  return last_kbd_key;
42  }
43  else
44  {
45  return 0;
46  }
47  }
48  else
49  {
50  last_kbd_key = 0;
51  return 0;
52  }
53  }
54 }
int kbd_is_blocked ( void  )

Definiert in Zeile 60 der Datei kbd_process.c.

61 {
62  return kbd_blocked;
63 }
long kbd_process ( )

Definiert in Zeile 81 der Datei kbd_process.c.

82 {
83  static int key_pressed;
84 
86 
88  {
90  {
91  case 1:
93  {
96  }
97  break;
98  case 2:
100  {
103  }
104  break;
105  }
106  }
107 
108  // check for & process non-keyboard script terminate
110 
111  // Reset keyboard auto repeat if no buttons pressed
112  if (kbd_get_pressed_key() == 0)
113  last_kbd_key = 0;
114 
115  // Set clicked key for scripts.
116  if (kbd_get_clicked_key())
117  {
120  }
121 
122  // Set Shutter Half Press state for GUI task.
124 
125  // Alternative keyboard mode stated/exited by pressing print key.
126  // While running Alt. mode shoot key will start a script execution.
127 
128  // alt-mode switch and delay emulation
129 
130  if ( key_pressed && !usb_remote_active )
131  {
133  || ((key_pressed >= CAM_EMUL_KEYPRESS_DELAY)
135  {
137  key_pressed++;
138  if (key_pressed == CAM_EMUL_KEYPRESS_DELAY)
140  else if (key_pressed == CAM_EMUL_KEYPRESS_DELAY+CAM_EMUL_KEYPRESS_DURATION)
142  return 1;
143  }
144  else if (kbd_get_pressed_key() == 0)
145  {
146  if (key_pressed < CAM_EMUL_KEYPRESS_DELAY)
147  {
148  if (!kbd_blocked)
149  {
150  // if start script on alt set, flag to run it
152  enter_alt();
153  }
154  else
155  exit_alt();
156  }
157  key_pressed = 0;
158  return 1;
159  }
160  return 1;
161  }
162 
163  // auto iso shift
165  return 0;
166 
168  {
169  key_pressed = 1;
171  return 1;
172  }
173 
174 #ifdef CAM_TOUCHSCREEN_UI
175  extern int ts_process_touch();
176  if (ts_process_touch())
177  {
179  }
180 #endif
181 
182  // deals with the rest
183 
184  if ( !kbd_blocked || usb_remote_active )
185  {
187  }
188 
189  if (gui_kbd_process())
190  return 1;
191 
193 
194  // Check if a PTP script needs to be started
195  // do this after action_stack_process_all so new script is not run until next timeslice
196  extern void start_ptp_script();
198 
199  return kbd_blocked;
200 }

Variablen-Dokumentation

int kbd_blocked

Definiert in Zeile 58 der Datei kbd_process.c.

long last_kbd_key = 0
static

Definiert in Zeile 16 der Datei kbd_process.c.

long last_kbd_time = 0
static

Definiert in Zeile 17 der Datei kbd_process.c.

long press_count = 0
static

Definiert in Zeile 18 der Datei kbd_process.c.