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
Signed by: Lephenixnoir
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 */
union {
/* Downward JWIDGET_KEY event or upwards JSCENE_KEY */
/* JWIDGET_KEY events */
key_event_t key;
};

View File

@ -37,7 +37,7 @@ typedef struct {
/* Events */
extern uint16_t JSCENE_NONE;
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 *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.
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. */
jevent jscene_run(jscene *scene);

View File

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