From 93242ef59b807419cf9ebe81c90829e90f1b518c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 1 Sep 2016 22:27:23 -0400 Subject: Make it possible to multiplex PuglKey and chars This is useful when working with existing code that assumes any key can be expressed in a single integer. Raises the question of whether Pugl's design of representing special keys separately at all is sensible, but c'est la vie. --- pugl/common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pugl/common.h b/pugl/common.h index 6109fe2..df57dc8 100644 --- a/pugl/common.h +++ b/pugl/common.h @@ -84,9 +84,14 @@ typedef enum { /** Special (non-Unicode) keyboard keys. + + The numerical values of these symbols occupy a reserved range of Unicode + points, so it is possible to express either a PuglKey value or a Unicode + character in the same variable. This is sometimes useful for interfacing + with APIs that do not make this distinction. */ typedef enum { - PUGL_KEY_F1 = 1, + PUGL_KEY_F1 = 0xE000, PUGL_KEY_F2, PUGL_KEY_F3, PUGL_KEY_F4, -- cgit v1.2.1