<div dir="ltr"><div>I've been working through the <a href="https://xcb.freedesktop.org/tutorial/">tutorial</a> and everything was going swimmingly until I got to the bit about <a href="https://xcb.freedesktop.org/tutorial/fonts/">keyboard input</a>. Pressing the ESC key sends a value of 9 to the program, which is great, but how did the ESC key get translated to 9? The section of the program dealing with keyboard input is listed below.</div><div><br></div><div>I can enter characters at the keyboard, but the values that show up in the program are not the normal ASCII values. I've dug around a bit but I haven't found much of anything that was very helpful. </div><div><br></div><div>If you can offer any advice, I would appreciate hearing from you.</div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Chuck Pergiel<br>Silicon Forest<br><a href="http://www.pergelator.blogspot.com" target="_blank">www.pergelator.blogspot.com</a><br>Sent from my Commodore-64 via a US Robotics 300 Baud Modem<br></div><div><br></div><div>P.S. I'm running Linux Mint on an HP desktop PC, if that makes any difference.</div><div><br></div><div><pre style="overflow:auto;color:rgb(46,26,5);padding:0.5em;margin:1em;border-style:solid;border-width:2px;border-color:rgb(43,94,130);border-radius:4px"><code> /* event loop */
xcb_generic_event_t *event;
while (1) { ;
if ( (event = xcb_poll_for_event(connection)) ) {
switch (event->response_type & ~0x80) {
case XCB_EXPOSE: {
drawText (connection,
screen,
window,
10, HEIGHT - 10,
"Press ESC key to exit..." );
break;
}
case XCB_KEY_RELEASE: {
xcb_key_release_event_t *kr = (xcb_key_release_event_t *)event;
switch (kr->detail) {
/* ESC */
case 9: {
free (event);
xcb_disconnect (connection);
return 0;
}
}
free (event);
}
}
}
}
</code></pre></div><div><code><br></code></div></div></div></div></div></div>
</div>