Skip to content

Commit 032cde9

Browse files
committed
Update based on review
Signed-off-by: Boram Bae <[email protected]>
1 parent 7803f8f commit 032cde9

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

shell/platform/tizen/channels/key_event_channel.cc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ uint64_t GetLogicalKey(const char* key) {
6262
return ApplyPlaneToId(0, kTizenPlane);
6363
}
6464

65-
uint32_t GetFallbackScanCodeFromKey(std::string key) {
66-
// Some of the scan codes are 0 when keys event occur from the software
67-
// keyboard. then the key_event_channel cannot handle the key event.
68-
// to avoid this, use a valid scan codes.
69-
int scan_code = 0;
65+
uint32_t GetFallbackScanCodeFromKey(const std::string& key) {
66+
// Some of scan codes are 0 when key events occur from the software
67+
// keyboard, and key_event_channel cannot handle the key events.
68+
// To avoid this, use a valid scan code.
7069

7170
// The following keys can be emitted from the software keyboard and have a
7271
// scan code with 0 value.
@@ -75,12 +74,11 @@ uint32_t GetFallbackScanCodeFromKey(std::string key) {
7574
{"Right", 0x00000072}, {"Down", 0x00000074},
7675
};
7776

78-
auto iter1 = kKeyToScanCode.find(key);
79-
if (iter1 != kKeyToScanCode.end()) {
80-
scan_code = iter1->second;
77+
auto iter = kKeyToScanCode.find(key);
78+
if (iter != kKeyToScanCode.end()) {
79+
return iter->second;
8180
}
82-
83-
return scan_code;
81+
return 0;
8482
}
8583

8684
} // namespace

0 commit comments

Comments
 (0)