OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "mojo/tools/embed/data.h" | 8 #include "mojo/tools/embed/data.h" |
9 #include "services/keyboard_native/kActionIcon.h" | 9 #include "services/keyboard_native/kActionIcon.h" |
10 #include "services/keyboard_native/kDeleteIcon.h" | 10 #include "services/keyboard_native/kDeleteIcon.h" |
11 #include "services/keyboard_native/kLowerCaseIcon.h" | 11 #include "services/keyboard_native/kLowerCaseIcon.h" |
12 #include "services/keyboard_native/kUpperCaseIcon.h" | 12 #include "services/keyboard_native/kUpperCaseIcon.h" |
13 #include "services/keyboard_native/key_layout.h" | 13 #include "services/keyboard_native/key_layout.h" |
| 14 #include "services/keyboard_native/predictor.h" |
| 15 #include "services/keyboard_native/text_update_key.h" |
14 #include "skia/ext/refptr.h" | 16 #include "skia/ext/refptr.h" |
15 #include "third_party/skia/include/core/SkCanvas.h" | 17 #include "third_party/skia/include/core/SkCanvas.h" |
16 #include "third_party/skia/include/core/SkImageDecoder.h" | 18 #include "third_party/skia/include/core/SkImageDecoder.h" |
17 #include "third_party/skia/include/core/SkStream.h" | 19 #include "third_party/skia/include/core/SkStream.h" |
18 #include "third_party/skia/include/core/SkTypeface.h" | 20 #include "third_party/skia/include/core/SkTypeface.h" |
19 #include "ui/gfx/codec/png_codec.h" | 21 #include "ui/gfx/codec/png_codec.h" |
20 #include "ui/gfx/geometry/point_f.h" | 22 #include "ui/gfx/geometry/point_f.h" |
21 #include "ui/gfx/shadow_value.h" | 23 #include "ui/gfx/shadow_value.h" |
22 #include "ui/gfx/skia_util.h" | 24 #include "ui/gfx/skia_util.h" |
23 #include "ui/gfx/vector2d.h" | 25 #include "ui/gfx/vector2d.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 private: | 98 private: |
97 KeyLayout::TextKey text_key_; | 99 KeyLayout::TextKey text_key_; |
98 bool bitmap_valid_; | 100 bool bitmap_valid_; |
99 SkBitmap bitmap_; | 101 SkBitmap bitmap_; |
100 | 102 |
101 DISALLOW_COPY_AND_ASSIGN(ImageKey); | 103 DISALLOW_COPY_AND_ASSIGN(ImageKey); |
102 }; | 104 }; |
103 | 105 |
104 KeyLayout::KeyLayout() | 106 KeyLayout::KeyLayout() |
105 : on_text_callback_(), | 107 : on_text_callback_(), |
| 108 on_suggest_text_callback_(), |
106 layout_(&letters_layout_), | 109 layout_(&letters_layout_), |
107 key_map_(&lower_case_key_map_), | 110 key_map_(&lower_case_key_map_), |
| 111 predictor_(nullptr), |
108 weak_factory_(this) { | 112 weak_factory_(this) { |
109 InitLayouts(); | 113 InitLayouts(); |
110 InitKeyMaps(); | 114 InitKeyMaps(); |
111 } | 115 } |
112 | 116 |
113 KeyLayout::~KeyLayout() { | 117 KeyLayout::~KeyLayout() { |
114 for (auto& row : lower_case_key_map_) { | 118 for (auto& row : lower_case_key_map_) { |
115 for (auto& key : row) { | 119 for (auto& key : row) { |
116 delete key; | 120 delete key; |
117 } | 121 } |
(...skipping 12 matching lines...) Expand all Loading... |
130 | 134 |
131 void KeyLayout::SetTextCallback( | 135 void KeyLayout::SetTextCallback( |
132 base::Callback<void(const std::string&)> on_text_callback) { | 136 base::Callback<void(const std::string&)> on_text_callback) { |
133 on_text_callback_ = on_text_callback; | 137 on_text_callback_ = on_text_callback; |
134 } | 138 } |
135 | 139 |
136 void KeyLayout::SetDeleteCallback(base::Callback<void()> on_delete_callback) { | 140 void KeyLayout::SetDeleteCallback(base::Callback<void()> on_delete_callback) { |
137 on_delete_callback_ = on_delete_callback; | 141 on_delete_callback_ = on_delete_callback; |
138 } | 142 } |
139 | 143 |
| 144 void KeyLayout::SetSuggestTextCallback( |
| 145 base::Callback<void(const std::string&)> on_suggest_text_callback) { |
| 146 on_suggest_text_callback_ = on_suggest_text_callback; |
| 147 } |
| 148 |
140 void KeyLayout::SetKeyArea(const gfx::RectF& key_area) { | 149 void KeyLayout::SetKeyArea(const gfx::RectF& key_area) { |
141 key_area_ = key_area; | 150 key_area_ = key_area; |
142 } | 151 } |
143 | 152 |
144 void KeyLayout::Draw(SkCanvas* canvas) { | 153 void KeyLayout::Draw(SkCanvas* canvas) { |
145 // Add shadow beneath the key area. | 154 // Add shadow beneath the key area. |
146 int blur = 20; | 155 int blur = 20; |
147 SkColor color = SkColorSetARGB(0x80, 0, 0, 0); | 156 SkColor color = SkColorSetARGB(0x80, 0, 0, 0); |
148 std::vector<gfx::ShadowValue> shadows; | 157 std::vector<gfx::ShadowValue> shadows; |
149 shadows.push_back(gfx::ShadowValue(gfx::Vector2d(0, 0), blur, color)); | 158 shadows.push_back(gfx::ShadowValue(gfx::Vector2d(0, 0), blur, color)); |
(...skipping 17 matching lines...) Expand all Loading... |
167 text_paint.setTextAlign(SkPaint::kCenter_Align); | 176 text_paint.setTextAlign(SkPaint::kCenter_Align); |
168 | 177 |
169 SkPaint paint; | 178 SkPaint paint; |
170 for (size_t row_index = 0; row_index < layout_->size(); row_index++) { | 179 for (size_t row_index = 0; row_index < layout_->size(); row_index++) { |
171 float current_top = key_area_.y() + row_index * row_height; | 180 float current_top = key_area_.y() + row_index * row_height; |
172 float current_left = key_area_.x(); | 181 float current_left = key_area_.x(); |
173 for (size_t key_index = 0; key_index < (*layout_)[row_index].size(); | 182 for (size_t key_index = 0; key_index < (*layout_)[row_index].size(); |
174 key_index++) { | 183 key_index++) { |
175 float key_width = static_cast<float>(key_area_.width()) * | 184 float key_width = static_cast<float>(key_area_.width()) * |
176 (*layout_)[row_index][key_index]; | 185 (*layout_)[row_index][key_index]; |
177 | |
178 (*key_map_)[row_index][key_index]->Draw( | 186 (*key_map_)[row_index][key_index]->Draw( |
179 canvas, text_paint, | 187 canvas, text_paint, |
180 gfx::RectF(current_left, current_top, key_width, row_height)); | 188 gfx::RectF(current_left, current_top, key_width, row_height)); |
181 current_left += key_width; | 189 current_left += key_width; |
182 } | 190 } |
183 } | 191 } |
184 } | 192 } |
185 | 193 |
186 KeyLayout::Key* KeyLayout::GetKeyAtPoint(const gfx::PointF& point) { | 194 KeyLayout::Key* KeyLayout::GetKeyAtPoint(const gfx::PointF& point) { |
187 if (!key_area_.Contains(point)) { | 195 if (!key_area_.Contains(point)) { |
(...skipping 13 matching lines...) Expand all Loading... |
201 return (*key_map_)[row_index][key_index]; | 209 return (*key_map_)[row_index][key_index]; |
202 } | 210 } |
203 | 211 |
204 void KeyLayout::OnTouchUp(const gfx::PointF& touch_up) { | 212 void KeyLayout::OnTouchUp(const gfx::PointF& touch_up) { |
205 Key* key = GetKeyAtPoint(touch_up); | 213 Key* key = GetKeyAtPoint(touch_up); |
206 if (key != nullptr) { | 214 if (key != nullptr) { |
207 key->OnTouchUp(); | 215 key->OnTouchUp(); |
208 } | 216 } |
209 } | 217 } |
210 | 218 |
| 219 void KeyLayout::SetPredictor(Predictor* predictor) { |
| 220 predictor_ = predictor; |
| 221 predictor_->SetSuggestionKeys(lower_case_key_map_[0]); |
| 222 } |
| 223 |
211 void KeyLayout::InitLayouts() { | 224 void KeyLayout::InitLayouts() { |
212 // Row layouts are specified by a vector of floats which indicate the percent | 225 // Row layouts are specified by a vector of floats which indicate the percent |
213 // width a given key takes up in that row. The floats of a given row *MUST* | 226 // width a given key takes up in that row. The floats of a given row *MUST* |
214 // add up to 1. | 227 // add up to 1. |
215 std::vector<float> ten_key_row_layout = { | 228 std::vector<float> ten_key_row_layout = { |
216 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f}; | 229 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f}; |
217 std::vector<float> nine_key_row_layout = { | 230 std::vector<float> nine_key_row_layout = { |
218 0.15f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.15f}; | 231 0.15f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.15f}; |
219 std::vector<float> seven_key_row_layout = { | 232 std::vector<float> seven_key_row_layout = { |
220 0.15f, 0.1f, 0.1f, 0.3f, 0.1f, 0.1f, 0.15f}; | 233 0.15f, 0.1f, 0.1f, 0.3f, 0.1f, 0.1f, 0.15f}; |
221 std::vector<float> five_key_row_layout = {0.15f, 0.1f, 0.5f, 0.1f, 0.15f}; | 234 std::vector<float> five_key_row_layout = {0.15f, 0.1f, 0.5f, 0.1f, 0.15f}; |
| 235 std::vector<float> three_key_row_layout = {0.33f, 0.33f, 0.33f}; |
222 | 236 |
| 237 letters_layout_.push_back(three_key_row_layout); |
223 letters_layout_.push_back(ten_key_row_layout); | 238 letters_layout_.push_back(ten_key_row_layout); |
224 letters_layout_.push_back(nine_key_row_layout); | 239 letters_layout_.push_back(nine_key_row_layout); |
225 letters_layout_.push_back(nine_key_row_layout); | 240 letters_layout_.push_back(nine_key_row_layout); |
226 letters_layout_.push_back(five_key_row_layout); | 241 letters_layout_.push_back(five_key_row_layout); |
227 | 242 |
| 243 symbols_layout_.push_back(three_key_row_layout); |
228 symbols_layout_.push_back(ten_key_row_layout); | 244 symbols_layout_.push_back(ten_key_row_layout); |
229 symbols_layout_.push_back(nine_key_row_layout); | 245 symbols_layout_.push_back(nine_key_row_layout); |
230 symbols_layout_.push_back(nine_key_row_layout); | 246 symbols_layout_.push_back(nine_key_row_layout); |
231 symbols_layout_.push_back(seven_key_row_layout); | 247 symbols_layout_.push_back(seven_key_row_layout); |
232 } | 248 } |
233 | 249 |
234 void KeyLayout::OnKeyDoNothing(const TextKey& key) { | 250 void KeyLayout::OnKeyDoNothing(const TextKey& key) { |
235 // do nothing | 251 // do nothing |
236 } | 252 } |
237 | 253 |
238 void KeyLayout::OnKeyEmitText(const TextKey& key) { | 254 void KeyLayout::OnKeyEmitText(const TextKey& key) { |
| 255 predictor_->StoreCurWord(std::string(key.ToText())); |
239 on_text_callback_.Run(std::string(key.ToText())); | 256 on_text_callback_.Run(std::string(key.ToText())); |
240 } | 257 } |
241 | 258 |
242 void KeyLayout::OnKeyDelete(const TextKey& key) { | 259 void KeyLayout::OnKeyDelete(const TextKey& key) { |
| 260 predictor_->DeleteCharInCurWord(); |
243 on_delete_callback_.Run(); | 261 on_delete_callback_.Run(); |
244 } | 262 } |
245 | 263 |
| 264 void KeyLayout::OnSuggestKeyEmitText(const TextUpdateKey& key) { |
| 265 std::string update_string = std::string(key.ToText()); |
| 266 int delete_size = predictor_->ChooseSuggestedWord(std::string(key.ToText())); |
| 267 for (int i = 0; i < delete_size; i++) { |
| 268 on_delete_callback_.Run(); |
| 269 } |
| 270 on_suggest_text_callback_.Run(update_string); |
| 271 } |
| 272 |
246 void KeyLayout::OnKeySwitchToUpperCase(const TextKey& key) { | 273 void KeyLayout::OnKeySwitchToUpperCase(const TextKey& key) { |
247 layout_ = &letters_layout_; | 274 layout_ = &letters_layout_; |
248 key_map_ = &upper_case_key_map_; | 275 key_map_ = &upper_case_key_map_; |
| 276 predictor_->SetSuggestionKeys(upper_case_key_map_[0]); |
249 } | 277 } |
250 | 278 |
251 void KeyLayout::OnKeySwitchToLowerCase(const TextKey& key) { | 279 void KeyLayout::OnKeySwitchToLowerCase(const TextKey& key) { |
252 layout_ = &letters_layout_; | 280 layout_ = &letters_layout_; |
253 key_map_ = &lower_case_key_map_; | 281 key_map_ = &lower_case_key_map_; |
| 282 predictor_->SetSuggestionKeys(lower_case_key_map_[0]); |
254 } | 283 } |
255 | 284 |
256 void KeyLayout::OnKeySwitchToSymbols(const TextKey& key) { | 285 void KeyLayout::OnKeySwitchToSymbols(const TextKey& key) { |
257 layout_ = &symbols_layout_; | 286 layout_ = &symbols_layout_; |
258 key_map_ = &symbols_key_map_; | 287 key_map_ = &symbols_key_map_; |
| 288 predictor_->SetSuggestionKeys(symbols_key_map_[0]); |
259 } | 289 } |
260 | 290 |
261 void KeyLayout::InitKeyMaps() { | 291 void KeyLayout::InitKeyMaps() { |
262 base::Callback<void(const TextKey&)> do_nothing_callback = | 292 base::Callback<void(const TextKey&)> do_nothing_callback = |
263 base::Bind(&KeyLayout::OnKeyDoNothing, weak_factory_.GetWeakPtr()); | 293 base::Bind(&KeyLayout::OnKeyDoNothing, weak_factory_.GetWeakPtr()); |
264 base::Callback<void(const TextKey&)> emit_text_callback = | 294 base::Callback<void(const TextKey&)> emit_text_callback = |
265 base::Bind(&KeyLayout::OnKeyEmitText, weak_factory_.GetWeakPtr()); | 295 base::Bind(&KeyLayout::OnKeyEmitText, weak_factory_.GetWeakPtr()); |
266 base::Callback<void(const TextKey&)> delete_callback = | 296 base::Callback<void(const TextKey&)> delete_callback = |
267 base::Bind(&KeyLayout::OnKeyDelete, weak_factory_.GetWeakPtr()); | 297 base::Bind(&KeyLayout::OnKeyDelete, weak_factory_.GetWeakPtr()); |
| 298 base::Callback<void(const TextUpdateKey&)> suggest_emit_text_callback = |
| 299 base::Bind(&KeyLayout::OnSuggestKeyEmitText, weak_factory_.GetWeakPtr()); |
268 base::Callback<void(const TextKey&)> switch_to_upper_case_callback = | 300 base::Callback<void(const TextKey&)> switch_to_upper_case_callback = |
269 base::Bind(&KeyLayout::OnKeySwitchToUpperCase, | 301 base::Bind(&KeyLayout::OnKeySwitchToUpperCase, |
270 weak_factory_.GetWeakPtr()); | 302 weak_factory_.GetWeakPtr()); |
271 base::Callback<void(const TextKey&)> switch_to_lower_case_callback = | 303 base::Callback<void(const TextKey&)> switch_to_lower_case_callback = |
272 base::Bind(&KeyLayout::OnKeySwitchToLowerCase, | 304 base::Bind(&KeyLayout::OnKeySwitchToLowerCase, |
273 weak_factory_.GetWeakPtr()); | 305 weak_factory_.GetWeakPtr()); |
274 base::Callback<void(const TextKey&)> switch_to_symbols_callback = | 306 base::Callback<void(const TextKey&)> switch_to_symbols_callback = |
275 base::Bind(&KeyLayout::OnKeySwitchToSymbols, weak_factory_.GetWeakPtr()); | 307 base::Bind(&KeyLayout::OnKeySwitchToSymbols, weak_factory_.GetWeakPtr()); |
276 | 308 |
277 ImageKey* switch_to_upper_case_image_key = new ImageKey( | 309 ImageKey* switch_to_upper_case_image_key = new ImageKey( |
278 "/\\", switch_to_upper_case_callback, keyboard_native::kUpperCaseIcon); | 310 "/\\", switch_to_upper_case_callback, keyboard_native::kUpperCaseIcon); |
279 ImageKey* switch_to_lower_case_image_key = new ImageKey( | 311 ImageKey* switch_to_lower_case_image_key = new ImageKey( |
280 "\\/", switch_to_lower_case_callback, keyboard_native::kLowerCaseIcon); | 312 "\\/", switch_to_lower_case_callback, keyboard_native::kLowerCaseIcon); |
281 ImageKey* delete_image_key = | 313 ImageKey* delete_image_key = |
282 new ImageKey("<-", delete_callback, keyboard_native::kDeleteIcon); | 314 new ImageKey("<-", delete_callback, keyboard_native::kDeleteIcon); |
283 ImageKey* action_image_key = | 315 ImageKey* action_image_key = |
284 new ImageKey(":)", do_nothing_callback, keyboard_native::kActionIcon); | 316 new ImageKey(":)", do_nothing_callback, keyboard_native::kActionIcon); |
285 | 317 |
| 318 std::vector<Key*> suggestion_strip_key_map_row_lower = { |
| 319 new TextUpdateKey("", suggest_emit_text_callback), |
| 320 new TextUpdateKey("", suggest_emit_text_callback), |
| 321 new TextUpdateKey("", suggest_emit_text_callback)}; |
| 322 |
| 323 std::vector<Key*> suggestion_strip_key_map_row_upper = { |
| 324 new TextUpdateKey("", suggest_emit_text_callback), |
| 325 new TextUpdateKey("", suggest_emit_text_callback), |
| 326 new TextUpdateKey("", suggest_emit_text_callback)}; |
| 327 |
| 328 std::vector<Key*> suggestion_strip_key_map_row_symbol = { |
| 329 new TextUpdateKey("", suggest_emit_text_callback), |
| 330 new TextUpdateKey("", suggest_emit_text_callback), |
| 331 new TextUpdateKey("", suggest_emit_text_callback)}; |
| 332 |
286 std::vector<Key*> lower_case_key_map_row_one = { | 333 std::vector<Key*> lower_case_key_map_row_one = { |
287 new TextKey("q", emit_text_callback), | 334 new TextKey("q", emit_text_callback), |
288 new TextKey("w", emit_text_callback), | 335 new TextKey("w", emit_text_callback), |
289 new TextKey("e", emit_text_callback), | 336 new TextKey("e", emit_text_callback), |
290 new TextKey("r", emit_text_callback), | 337 new TextKey("r", emit_text_callback), |
291 new TextKey("t", emit_text_callback), | 338 new TextKey("t", emit_text_callback), |
292 new TextKey("y", emit_text_callback), | 339 new TextKey("y", emit_text_callback), |
293 new TextKey("u", emit_text_callback), | 340 new TextKey("u", emit_text_callback), |
294 new TextKey("o", emit_text_callback), | 341 new TextKey("o", emit_text_callback), |
295 new TextKey("i", emit_text_callback), | 342 new TextKey("i", emit_text_callback), |
(...skipping 21 matching lines...) Expand all Loading... |
317 new TextKey("m", emit_text_callback), | 364 new TextKey("m", emit_text_callback), |
318 delete_image_key}; | 365 delete_image_key}; |
319 | 366 |
320 std::vector<Key*> lower_case_key_map_row_four = { | 367 std::vector<Key*> lower_case_key_map_row_four = { |
321 new TextKey("sym", switch_to_symbols_callback), | 368 new TextKey("sym", switch_to_symbols_callback), |
322 new TextKey(",", emit_text_callback), | 369 new TextKey(",", emit_text_callback), |
323 new TextKey(" ", emit_text_callback), | 370 new TextKey(" ", emit_text_callback), |
324 new TextKey(".", emit_text_callback), | 371 new TextKey(".", emit_text_callback), |
325 action_image_key}; | 372 action_image_key}; |
326 | 373 |
327 lower_case_key_map_ = {lower_case_key_map_row_one, | 374 lower_case_key_map_ = {suggestion_strip_key_map_row_lower, |
| 375 lower_case_key_map_row_one, |
328 lower_case_key_map_row_two, | 376 lower_case_key_map_row_two, |
329 lower_case_key_map_row_three, | 377 lower_case_key_map_row_three, |
330 lower_case_key_map_row_four}; | 378 lower_case_key_map_row_four}; |
331 | 379 |
332 std::vector<Key*> upper_case_key_map_row_one = { | 380 std::vector<Key*> upper_case_key_map_row_one = { |
333 new TextKey("Q", emit_text_callback), | 381 new TextKey("Q", emit_text_callback), |
334 new TextKey("W", emit_text_callback), | 382 new TextKey("W", emit_text_callback), |
335 new TextKey("E", emit_text_callback), | 383 new TextKey("E", emit_text_callback), |
336 new TextKey("R", emit_text_callback), | 384 new TextKey("R", emit_text_callback), |
337 new TextKey("T", emit_text_callback), | 385 new TextKey("T", emit_text_callback), |
(...skipping 25 matching lines...) Expand all Loading... |
363 new TextKey("M", emit_text_callback), | 411 new TextKey("M", emit_text_callback), |
364 delete_image_key}; | 412 delete_image_key}; |
365 | 413 |
366 std::vector<Key*> upper_case_key_map_row_four = { | 414 std::vector<Key*> upper_case_key_map_row_four = { |
367 new TextKey("SYM", switch_to_symbols_callback), | 415 new TextKey("SYM", switch_to_symbols_callback), |
368 new TextKey(",", emit_text_callback), | 416 new TextKey(",", emit_text_callback), |
369 new TextKey(" ", emit_text_callback), | 417 new TextKey(" ", emit_text_callback), |
370 new TextKey(".", emit_text_callback), | 418 new TextKey(".", emit_text_callback), |
371 action_image_key}; | 419 action_image_key}; |
372 | 420 |
373 upper_case_key_map_ = {upper_case_key_map_row_one, | 421 upper_case_key_map_ = {suggestion_strip_key_map_row_upper, |
| 422 upper_case_key_map_row_one, |
374 upper_case_key_map_row_two, | 423 upper_case_key_map_row_two, |
375 upper_case_key_map_row_three, | 424 upper_case_key_map_row_three, |
376 upper_case_key_map_row_four}; | 425 upper_case_key_map_row_four}; |
377 | 426 |
378 std::vector<Key*> symbols_key_map_row_one = { | 427 std::vector<Key*> symbols_key_map_row_one = { |
379 new TextKey("1", emit_text_callback), | 428 new TextKey("1", emit_text_callback), |
380 new TextKey("2", emit_text_callback), | 429 new TextKey("2", emit_text_callback), |
381 new TextKey("3", emit_text_callback), | 430 new TextKey("3", emit_text_callback), |
382 new TextKey("4", emit_text_callback), | 431 new TextKey("4", emit_text_callback), |
383 new TextKey("5", emit_text_callback), | 432 new TextKey("5", emit_text_callback), |
(...skipping 27 matching lines...) Expand all Loading... |
411 | 460 |
412 std::vector<Key*> symbols_key_map_row_four = { | 461 std::vector<Key*> symbols_key_map_row_four = { |
413 new TextKey("ABC", switch_to_lower_case_callback), | 462 new TextKey("ABC", switch_to_lower_case_callback), |
414 new TextKey(",", emit_text_callback), | 463 new TextKey(",", emit_text_callback), |
415 new TextKey("_", emit_text_callback), | 464 new TextKey("_", emit_text_callback), |
416 new TextKey(" ", emit_text_callback), | 465 new TextKey(" ", emit_text_callback), |
417 new TextKey("/", emit_text_callback), | 466 new TextKey("/", emit_text_callback), |
418 new TextKey(".", emit_text_callback), | 467 new TextKey(".", emit_text_callback), |
419 action_image_key}; | 468 action_image_key}; |
420 | 469 |
421 symbols_key_map_ = {symbols_key_map_row_one, | 470 symbols_key_map_ = {suggestion_strip_key_map_row_symbol, |
| 471 symbols_key_map_row_one, |
422 symbols_key_map_row_two, | 472 symbols_key_map_row_two, |
423 symbols_key_map_row_three, | 473 symbols_key_map_row_three, |
424 symbols_key_map_row_four}; | 474 symbols_key_map_row_four}; |
425 } | 475 } |
426 } | 476 |
427 // namespace keyboard | 477 } // namespace keyboard |
OLD | NEW |