CHDK_DE Vorschauversion  Trunk Rev. 6014
 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 (int script_mode)
 
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 ( int  script_mode)

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  // update any state that needs to be updated regularly in shooting
126  extern void shooting_update_state(void);
128 
129  // Alternative keyboard mode stated/exited by pressing print key.
130  // While running Alt. mode shoot key will start a script execution.
131 
132  // alt-mode switch and delay emulation
133 
134  if ( key_pressed && !usb_remote_active )
135  {
137  || ((key_pressed >= CAM_EMUL_KEYPRESS_DELAY)
139  {
141  key_pressed++;
142  if (key_pressed == CAM_EMUL_KEYPRESS_DELAY)
144  else if (key_pressed == CAM_EMUL_KEYPRESS_DELAY+CAM_EMUL_KEYPRESS_DURATION)
146  return 1;
147  }
148  else if (kbd_get_pressed_key() == 0)
149  {
150  if (key_pressed < CAM_EMUL_KEYPRESS_DELAY)
151  {
152  if (!kbd_blocked)
153  {
154  // if start script on alt set, flag to run it
157  }
158  else
159  exit_alt();
160  }
161  key_pressed = 0;
162  return 1;
163  }
164  return 1;
165  }
166 
167  // auto iso shift
169  return 0;
170 
172  {
173  key_pressed = 1;
175  return 1;
176  }
177 
178 #ifdef CAM_TOUCHSCREEN_UI
179  extern int ts_process_touch();
180  if (ts_process_touch())
181  {
183  }
184 #endif
185 
186  // deals with the rest
187 
188  if ( !kbd_blocked || usb_remote_active )
189  {
191  }
192 
193  if (gui_kbd_process())
194  return 1;
195 
197 
198  // Check if a PTP script needs to be started
199  // do this after action_stack_process_all so new script is not run until next timeslice
200  extern void start_ptp_script();
202 
203  return kbd_blocked;
204 }

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.