| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/ozone/platform/caca/caca_event_factory.h" | 5 #include "ui/ozone/platform/caca/caca_event_factory.h" |
| 6 | 6 |
| 7 #include <caca.h> | 7 #include <caca.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 switch (type) { | 185 switch (type) { |
| 186 case ui::ET_KEY_PRESSED: | 186 case ui::ET_KEY_PRESSED: |
| 187 case ui::ET_KEY_RELEASED: { | 187 case ui::ET_KEY_RELEASED: { |
| 188 if (pressed) | 188 if (pressed) |
| 189 modifier_flags_ |= ModifierFromKey(*event); | 189 modifier_flags_ |= ModifierFromKey(*event); |
| 190 else | 190 else |
| 191 modifier_flags_ &= ~ModifierFromKey(*event); | 191 modifier_flags_ &= ~ModifierFromKey(*event); |
| 192 | 192 |
| 193 ui::KeyEvent key_event( | 193 ui::KeyEvent key_event( |
| 194 type, GetKeyboardCode(*event), modifier_flags_, false); | 194 type, GetKeyboardCode(*event), modifier_flags_); |
| 195 window->OnCacaEvent(&key_event); | 195 window->OnCacaEvent(&key_event); |
| 196 break; | 196 break; |
| 197 } | 197 } |
| 198 case ui::ET_MOUSE_MOVED: | 198 case ui::ET_MOUSE_MOVED: |
| 199 last_cursor_location_.SetPoint(caca_get_event_mouse_x(event), | 199 last_cursor_location_.SetPoint(caca_get_event_mouse_x(event), |
| 200 caca_get_event_mouse_y(event)); | 200 caca_get_event_mouse_y(event)); |
| 201 // Update cursor location. | 201 // Update cursor location. |
| 202 caca_gotoxy(caca_get_canvas(window->display()), | 202 caca_gotoxy(caca_get_canvas(window->display()), |
| 203 last_cursor_location_.x(), | 203 last_cursor_location_.x(), |
| 204 last_cursor_location_.y()); | 204 last_cursor_location_.y()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 226 window->OnCacaEvent(&mouse_event2); | 226 window->OnCacaEvent(&mouse_event2); |
| 227 break; | 227 break; |
| 228 } | 228 } |
| 229 default: | 229 default: |
| 230 NOTIMPLEMENTED(); | 230 NOTIMPLEMENTED(); |
| 231 break; | 231 break; |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace ui | 235 } // namespace ui |
| OLD | NEW |