Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: remoting/client/native_device_keymap_ios.cc

Issue 2868383003: [CRD iOS] Send key events to the session. (Closed)
Patch Set: Clean up old key input code. No longer used. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/client/native_device_keymap.h" 5 #include "remoting/client/native_device_keymap.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace { 9 namespace {
10 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 0x070056, // NUMPAD_SUBTRACT 194 0x070056, // NUMPAD_SUBTRACT
195 0x070057, // NUMPAD_ADD 195 0x070057, // NUMPAD_ADD
196 0x070063, // NUMPAD_DOT 196 0x070063, // NUMPAD_DOT
197 0x070085, // NUMPAD_COMMA 197 0x070085, // NUMPAD_COMMA
198 0x070058, // NUMPAD_ENTER 198 0x070058, // NUMPAD_ENTER
199 0x070067, // NUMPAD_EQUALS 199 0x070067, // NUMPAD_EQUALS
200 0x0700b6, // NUMPAD_LEFT_PAREN 200 0x0700b6, // NUMPAD_LEFT_PAREN
201 0x0700b7, // NUMPAD_RIGHT_PAREN 201 0x0700b7, // NUMPAD_RIGHT_PAREN
202 }; 202 };
203 203
204 const remoting::KeycodeWithModifier ascii_keycode_combo[] = {
205 // [#] Numbering fields by index.
206 {0, 0}, // [0]
207 {0, 0}, //
208 {0, 0}, //
209 {0, 0}, //
210 {0, 0}, //
211 {0, 0}, //
212 {0, 0}, //
213 {0, 0}, //
214 {0, 0}, //
215 {0, 0}, //
216 {0x070028, 0}, // [10] ENTER
217 {0, 0}, //
218 {0, 0}, //
219 {0, 0}, //
220 {0, 0}, //
221 {0, 0}, //
222 {0, 0}, //
223 {0, 0}, //
224 {0, 0}, //
225 {0, 0}, //
226 {0, 0}, // [20]
227 {0, 0}, //
228 {0, 0}, //
229 {0, 0}, //
230 {0, 0}, //
231 {0, 0}, //
232 {0, 0}, //
233 {0, 0}, //
234 {0, 0}, //
235 {0, 0}, //
236 {0, 0}, // [30]
237 {0, 0}, //
238 {0x07002c, 0}, // SPACE
239 {0x07001e, 0x0700e1}, // !
240 {0x070034, 0x0700e1}, // "
241 {0x070020, 0x0700e1}, // #
242 {0x070021, 0x0700e1}, // $
243 {0x070022, 0x0700e1}, // %
244 {0x070024, 0x0700e1}, // &
245 {0x070034, 0}, // '
246 {0x070026, 0x0700e1}, // [40] (
247 {0x070027, 0x0700e1}, // )
248 {0x070025, 0x0700e1}, // *
249 {0x07002e, 0x0700e1}, // +
250 {0x070036, 0}, // ,
251 {0x07002d, 0}, // -
252 {0x070037, 0}, // .
253 {0x070038, 0}, // /
254 {0x070027, 0}, // 0
255 {0x07001e, 0}, // 1
256 {0x07001f, 0}, // [50] 2
257 {0x070020, 0}, // 3
258 {0x070021, 0}, // 4
259 {0x070022, 0}, // 5
260 {0x070023, 0}, // 6
261 {0x070024, 0}, // 7
262 {0x070025, 0}, // 8
263 {0x070026, 0}, // 9
264 {0x070033, 0x0700e1}, // :
265 {0x070033, 0}, // ;
266 {0x070036, 0x0700e1}, // [60] <
267 {0x07002e, 0}, // =
268 {0x070037, 0x0700e1}, // >
269 {0x070038, 0x0700e1}, // ?
270 {0x07001f, 0x0700e1}, // @
271 {0x070004, 0x0700e1}, // A
272 {0x070005, 0x0700e1}, // B
273 {0x070006, 0x0700e1}, // C
274 {0x070007, 0x0700e1}, // D
275 {0x070008, 0x0700e1}, // E
276 {0x070009, 0x0700e1}, // [70] F
277 {0x07000a, 0x0700e1}, // G
278 {0x07000b, 0x0700e1}, // H
279 {0x07000c, 0x0700e1}, // I
280 {0x07000d, 0x0700e1}, // J
281 {0x07000e, 0x0700e1}, // K
282 {0x07000f, 0x0700e1}, // L
283 {0x070010, 0x0700e1}, // M
284 {0x070011, 0x0700e1}, // N
285 {0x070012, 0x0700e1}, // O
286 {0x070013, 0x0700e1}, // [80] P
287 {0x070014, 0x0700e1}, // Q
288 {0x070015, 0x0700e1}, // R
289 {0x070016, 0x0700e1}, // S
290 {0x070017, 0x0700e1}, // T
291 {0x070018, 0x0700e1}, // U
292 {0x070019, 0x0700e1}, // V
293 {0x07001a, 0x0700e1}, // W
294 {0x07001b, 0x0700e1}, // X
295 {0x07001c, 0x0700e1}, // Y
296 {0x07001d, 0x0700e1}, // [90] Z
297 {0x07002f, 0}, // [
298 {0x070031, 0}, // BACKSLASH
299 {0x070030, 0}, // ]
300 {0x070023, 0x0700e1}, // ^
301 {0x07002d, 0x0700e1}, // _
302 {0, 0}, //
303 {0x070004, 0}, // a
304 {0x070005, 0}, // b
305 {0x070006, 0}, // c
306 {0x070007, 0}, // [100] d
307 {0x070008, 0}, // e
308 {0x070009, 0}, // f
309 {0x07000a, 0}, // g
310 {0x07000b, 0}, // h
311 {0x07000c, 0}, // i
312 {0x07000d, 0}, // j
313 {0x07000e, 0}, // k
314 {0x07000f, 0}, // l
315 {0x070010, 0}, // m
316 {0x070011, 0}, // [110] n
317 {0x070012, 0}, // o
318 {0x070013, 0}, // p
319 {0x070014, 0}, // q
320 {0x070015, 0}, // r
321 {0x070016, 0}, // s
322 {0x070017, 0}, // t
323 {0x070018, 0}, // u
324 {0x070019, 0}, // v
325 {0x07001a, 0}, // w
326 {0x07001b, 0}, // [120] x
327 {0x07001c, 0}, // y
328 {0x07001d, 0}, // z
329 {0x07002f, 0x0700e1}, // {
330 {0x070031, 0x0700e1}, // |
331 {0x070030, 0x0700e1}, // }
332 {0x070035, 0x0700e1}, // ~
333 {0, 0}, // [127]
334 {0x0700e1, 0}, // SHIFT
335 {0x07002a, 0}, // BACKSPACE
336 {0x0700e0, 0}, // CTRL
337 {0x0700e2, 0}, // ALT
338 {0x07004c, 0} // DEL
339 };
340
204 } // namespace 341 } // namespace
205 342
206 namespace remoting { 343 namespace remoting {
207 344
208 uint32_t NativeDeviceKeycodeToUsbKeycode(size_t device_keycode) { 345 uint32_t NativeDeviceKeycodeToUsbKeycode(size_t device_keycode) {
209 if (device_keycode >= sizeof(usb_keycodes) / sizeof(uint32_t)) { 346 if (device_keycode >= sizeof(usb_keycodes) / sizeof(uint32_t)) {
210 LOG(WARNING) << "Attempted to decode out-of-range Android keycode"; 347 LOG(WARNING) << "Attempted to decode out-of-range keycode.";
211 return 0; 348 return 0;
212 } 349 }
213 350
214 return usb_keycodes[device_keycode]; 351 return usb_keycodes[device_keycode];
215 } 352 }
216 353
354 KeycodeWithModifier AsciiToUsbKeycodeWithModifier(const char& ascii) {
355 size_t ascii_index = (size_t)ascii;
356 if (ascii_index >= sizeof(ascii_keycode_combo) / sizeof(uint32_t)) {
357 LOG(WARNING) << "Attempted to decode out-of-range ascii character.";
358 return ascii_keycode_combo[0];
359 }
360
361 return ascii_keycode_combo[ascii_index];
362 }
363
217 } // namespace remoting 364 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698