fix crash for mute key

This commit is contained in:
chrys 2018-09-07 23:01:32 +02:00
parent 8614e19b25
commit 427f63d0d5

View File

@ -237,7 +237,14 @@ class driver(inputDriver):
return None
mEvent = inputData.inputEvent
try:
# mute is a list = ['KEY_MIN_INTERESTING', 'KEY_MUTE']
mEvent['EventName'] = evdev.ecodes.keys[event.code]
if isinstance(mEvent['EventName'], list):
if len(mEvent['EventName']) > 0:
mEvent['EventName'] = mEvent['EventName'][0]
if isinstance(mEvent['EventName'], list):
if len(mEvent['EventName']) > 0:
mEvent['EventName'] = mEvent['EventName'][0]
mEvent['EventValue'] = event.code
mEvent['EventSec'] = event.sec
mEvent['EventUsec'] = event.usec