diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/goldfish_events_device.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/hw/goldfish_events_device.c b/hw/goldfish_events_device.c index 3072e3b..a5b2a21 100644 --- a/hw/goldfish_events_device.c +++ b/hw/goldfish_events_device.c @@ -102,8 +102,6 @@ static int events_state_load(QEMUFile* f, void* opaque, int version_id) return qemu_get_struct(f, events_state_fields, s); } -extern const char* android_skin_keycharmap; - static void enqueue_event(events_state *s, unsigned int type, unsigned int code, int value) { int enqueued = s->last - s->first; @@ -169,22 +167,11 @@ static unsigned dequeue_event(events_state *s) return n; } -static const char* -get_charmap_name(events_state *s) -{ - if (s->name != NULL) - return s->name; - - s->name = android_get_charmap_name(); - return s->name; -} - - static int get_page_len(events_state *s) { int page = s->page; if (page == PAGE_NAME) { - const char* name = get_charmap_name(s); + const char* name = s->name; return strlen(name); } if (page >= PAGE_EVBITS && page <= PAGE_EVBITS + EV_MAX) return s->ev_bits[page - PAGE_EVBITS].len; @@ -200,7 +187,7 @@ static int get_page_data(events_state *s, int offset) if (offset > page_len) return 0; if (page == PAGE_NAME) { - const char* name = get_charmap_name(s); + const char* name = s->name; return name[offset]; } if (page >= PAGE_EVBITS && page <= PAGE_EVBITS + EV_MAX) return s->ev_bits[page - PAGE_EVBITS].bits[offset]; @@ -347,9 +334,6 @@ void events_dev_init(uint32_t base, qemu_irq irq) s = (events_state *) qemu_mallocz(sizeof(events_state)); - // charmap name will be determined on demand - s->name = NULL; - /* now set the events capability bits depending on hardware configuration */ /* apparently, the EV_SYN array is used to indicate which other * event classes to consider. @@ -514,6 +498,7 @@ void events_dev_init(uint32_t base, qemu_irq irq) s->first = 0; s->last = 0; s->state = STATE_INIT; + s->name = qemu_strdup(config->hw_keyboard_charmap); /* This function migh fire buffered events to the device, so * ensure that it is called after initialization is complete |