Lines Matching defs:Behavior
233 const Behavior* behavior;
234 if (getKeyBehavior(keyCode, metaState, &key, &behavior)) {
235 result = behavior->character;
250 const Behavior* behavior;
251 if (getKeyBehavior(keyCode, metaState, &key, &behavior)) {
252 if (behavior->fallbackKeyCode) {
253 outFallbackAction->keyCode = behavior->fallbackKeyCode;
254 outFallbackAction->metaState = metaState & ~behavior->metaState;
272 // Try to find the most general behavior that maps to this character.
273 // For example, the base key behavior will usually be last in the list.
274 // However, if we find a perfect meta state match for one behavior then use that one.
275 for (const Behavior* behavior = key->firstBehavior; behavior; behavior = behavior->next) {
276 if (behavior->character) {
278 if (behavior->character == chars[i]) {
279 result = behavior->character;
280 if ((behavior->metaState & metaState) == behavior->metaState) {
371 const Key** outKey, const Behavior** outBehavior) const {
374 const Behavior* behavior = key->firstBehavior;
375 while (behavior) {
376 if (matchesMetaState(metaState, behavior->metaState)) {
378 *outBehavior = behavior;
381 behavior = behavior->next;
388 // Behavior must have at least the set of meta states specified.
389 // And if the key event has CTRL, ALT or META then the behavior must exactly
390 // match those, taking into account that a behavior can specify that it handles
426 // Try to find the most general behavior that maps to this character.
427 // For example, the base key behavior will usually be last in the list.
428 const Behavior* found = NULL;
429 for (const Behavior* behavior = key->firstBehavior; behavior; behavior = behavior->next) {
430 if (behavior->character == ch) {
431 found = behavior;
581 Behavior* lastBehavior = NULL;
590 Behavior* behavior = new Behavior();
591 behavior->metaState = metaState;
592 behavior->character = character;
593 behavior->fallbackKeyCode = fallbackKeyCode;
595 lastBehavior->next = behavior;
597 key->firstBehavior = behavior;
599 lastBehavior = behavior;
620 for (const Behavior* behavior = key->firstBehavior; behavior != NULL;
621 behavior = behavior->next) {
623 parcel->writeInt32(behavior->metaState);
624 parcel->writeInt32(behavior->character);
625 parcel->writeInt32(behavior->fallbackKeyCode);
641 firstBehavior(other.firstBehavior ? new Behavior(*other.firstBehavior) : NULL) {
645 Behavior* behavior = firstBehavior;
646 while (behavior) {
647 Behavior* next = behavior->next;
648 delete behavior;
649 behavior = next;
654 // --- KeyCharacterMap::Behavior ---
656 KeyCharacterMap::Behavior::Behavior() :
660 KeyCharacterMap::Behavior::Behavior(const Behavior& other) :
661 next(other.next ? new Behavior(*other.next) : NULL),
919 // Parse behavior after the colon.
922 Behavior behavior;
941 behavior.character = character;
957 ALOGE("%s: Invalid key code label for fallback behavior, got '%s'.",
967 behavior.fallbackKeyCode = keyCode;
970 ALOGE("%s: Expected a key behavior after ':'.",
979 // Add the behavior.
989 key->label = behavior.character;
1000 key->number = behavior.character;
1006 for (Behavior* b = key->firstBehavior; b; b = b->next) {
1008 ALOGE("%s: Duplicate key behavior for modifier.",
1013 Behavior* newBehavior = new Behavior(behavior);
1033 for (Behavior* b = key->firstBehavior; b; b = b->next) {