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

Unified Diff: chrome/browser/extensions/api/braille_display_private/brlapi_keycode_map.cc

Issue 2463983002: Implement support for chorded braille commands (Closed)
Patch Set: Add more commands. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/braille_display_private/brlapi_keycode_map.cc
diff --git a/chrome/browser/extensions/api/braille_display_private/brlapi_keycode_map.cc b/chrome/browser/extensions/api/braille_display_private/brlapi_keycode_map.cc
index 1e8a9530699e84a6c938ed339f040f22b41ba2d7..0b7a2143eac7a5452595180632c025be327b16d2 100644
--- a/chrome/browser/extensions/api/braille_display_private/brlapi_keycode_map.cc
+++ b/chrome/browser/extensions/api/braille_display_private/brlapi_keycode_map.cc
@@ -142,8 +142,12 @@ void MapCommand(brlapi_keyCode_t code, KeyEvent* event) {
event->display_position.reset(new int(argument));
break;
case BRLAPI_KEY_CMD_PASSDOTS:
- event->command = KEY_COMMAND_DOTS;
- event->braille_dots.reset(new int(argument & kAllDots));
+ unsigned int dots = argument & kAllDots;
+ event->braille_dots.reset(new int(dots));
+ if (dots && argument & BRLAPI_DOTC)
dmazzoni 2016/11/01 16:22:37 nit: I prefer parens around the bitwise and clause
David Tseng 2016/11/01 20:11:59 Done.
+ event->command = KEY_COMMAND_CHORD;
+ else
+ event->command = KEY_COMMAND_DOTS;
dmazzoni 2016/11/01 16:23:04 nit: indentation of this line and two lines previo
David Tseng 2016/11/01 20:11:59 Done.
MapModifierFlags(code, event);
break;
}

Powered by Google App Engine
This is Rietveld 408576698