MCPcopy Create free account
hub / github.com/davisking/dlib / win

Class win

dlib/test/gui/main.cpp:144–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142
143
144class win : public drawable_window
145{
146
147 label lbl_last_keydown;
148 label lbl_mod_shift;
149 label lbl_mod_control;
150 label lbl_mod_alt;
151 label lbl_mod_meta;
152 label lbl_mod_caps_lock;
153 label lbl_mod_num_lock;
154 label lbl_mod_scroll_lock;
155 void on_keydown (
156 unsigned long key,
157 bool is_printable,
158 unsigned long state
159 )
160 {
161 if (is_printable)
162 lbl_last_keydown.set_text(string("last keydown: ") + (char)key);
163 else
164 lbl_last_keydown.set_text(string("last keydown: nonprintable"));
165
166 if (state&base_window::KBD_MOD_SHIFT)
167 lbl_mod_shift.set_text("shift is on");
168 else
169 lbl_mod_shift.set_text("shift is off");
170
171 if (state&base_window::KBD_MOD_CONTROL)
172 lbl_mod_control.set_text("control is on");
173 else
174 lbl_mod_control.set_text("control is off");
175
176 if (state&base_window::KBD_MOD_ALT)
177 lbl_mod_alt.set_text("alt is on");
178 else
179 lbl_mod_alt.set_text("alt is off");
180
181
182 if (state&base_window::KBD_MOD_META)
183 lbl_mod_meta.set_text("meta is on");
184 else
185 lbl_mod_meta.set_text("meta is off");
186
187 if (state&base_window::KBD_MOD_CAPS_LOCK)
188 lbl_mod_caps_lock.set_text("caps_lock is on");
189 else
190 lbl_mod_caps_lock.set_text("caps_lock is off");
191
192 if (state&base_window::KBD_MOD_NUM_LOCK)
193 lbl_mod_num_lock.set_text("num_lock is on");
194 else
195 lbl_mod_num_lock.set_text("num_lock is off");
196
197
198 if (state&base_window::KBD_MOD_SCROLL_LOCK)
199 lbl_mod_scroll_lock.set_text("scroll_lock is on");
200 else
201 lbl_mod_scroll_lock.set_text("scroll_lock is off");

Callers 2

stft_implFunction · 0.50
istft_implFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected