jscene: merge JSCENE_KEY with JWIDGET_KEY

Since both propagate anyway, there's no reason to separate them.
This commit is contained in:
Lephenixnoir 2021-05-30 10:40:58 +02:00
parent 6f6af63ec3
commit 6ca607ae37
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495
3 changed files with 5 additions and 5 deletions

View file

@ -41,7 +41,7 @@ typedef struct {
/* Event details or data */ /* Event details or data */
union { union {
/* Downward JWIDGET_KEY event or upwards JSCENE_KEY */ /* JWIDGET_KEY events */
key_event_t key; key_event_t key;
}; };

View file

@ -37,7 +37,7 @@ typedef struct {
/* Events */ /* Events */
extern uint16_t JSCENE_NONE; extern uint16_t JSCENE_NONE;
extern uint16_t JSCENE_PAINT; extern uint16_t JSCENE_PAINT;
extern uint16_t JSCENE_KEY; extern uint16_t JSCENE_KEY; /* Deprecated, merged with JWIDGET_KEY */
/* jscene_create(): Create a new scene at that specified screen position */ /* jscene_create(): Create a new scene at that specified screen position */
jscene *jscene_create(int x, int y, int w, int h, void *parent); jscene *jscene_create(int x, int y, int w, int h, void *parent);
@ -104,7 +104,7 @@ bool jscene_process_event(jscene *scene, jevent event);
scene. scene.
If a scene event occurs, returns it. If a key event occurs, an event of type If a scene event occurs, returns it. If a key event occurs, an event of type
JSCENE_KEY is return and its .key attribute contains the details of the JWIDGET_KEY is return and its .key attribute contains the details of the
forwarded keyboard event. */ forwarded keyboard event. */
jevent jscene_run(jscene *scene); jevent jscene_run(jscene *scene);

View file

@ -197,7 +197,7 @@ jevent jscene_run(jscene *s)
} }
#endif #endif
if(k.type != KEYEV_NONE && !jscene_process_key_event(s, k)) { if(k.type != KEYEV_NONE && !jscene_process_key_event(s, k)) {
e.type = JSCENE_KEY; e.type = JWIDGET_KEY;
e.key = k; e.key = k;
break; break;
} }
@ -225,5 +225,5 @@ static void j_register_jscene(void)
jscene_type_id = j_register_widget(&type_jscene, "jwidget"); jscene_type_id = j_register_widget(&type_jscene, "jwidget");
JSCENE_NONE = j_register_event(); JSCENE_NONE = j_register_event();
JSCENE_PAINT = j_register_event(); JSCENE_PAINT = j_register_event();
JSCENE_KEY = j_register_event(); JSCENE_KEY = JWIDGET_KEY;
} }