X11 event comment cleanup.

This commit is contained in:
Camilla Berglund 2013-01-12 21:11:41 +01:00
parent fcb96967ba
commit 9726597794

View File

@ -481,7 +481,6 @@ static void processEvent(XEvent *event)
{ {
case KeyPress: case KeyPress:
{ {
// A keyboard key was pressed
window = findWindow(event->xkey.window); window = findWindow(event->xkey.window);
if (window == NULL) if (window == NULL)
return; return;
@ -493,7 +492,6 @@ static void processEvent(XEvent *event)
case KeyRelease: case KeyRelease:
{ {
// A keyboard key was released
window = findWindow(event->xkey.window); window = findWindow(event->xkey.window);
if (window == NULL) if (window == NULL)
return; return;
@ -504,7 +502,6 @@ static void processEvent(XEvent *event)
case ButtonPress: case ButtonPress:
{ {
// A mouse button was pressed or a scrolling event occurred
window = findWindow(event->xbutton.window); window = findWindow(event->xbutton.window);
if (window == NULL) if (window == NULL)
return; return;
@ -516,13 +513,11 @@ static void processEvent(XEvent *event)
else if (event->xbutton.button == Button3) else if (event->xbutton.button == Button3)
_glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_RIGHT, GLFW_PRESS); _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_RIGHT, GLFW_PRESS);
// XFree86 3.3.2 and later translates mouse wheel up/down into // Modern X provides scroll events as mouse button presses
// mouse button 4 & 5 presses
else if (event->xbutton.button == Button4) else if (event->xbutton.button == Button4)
_glfwInputScroll(window, 0.0, 1.0); _glfwInputScroll(window, 0.0, 1.0);
else if (event->xbutton.button == Button5) else if (event->xbutton.button == Button5)
_glfwInputScroll(window, 0.0, -1.0); _glfwInputScroll(window, 0.0, -1.0);
else if (event->xbutton.button == Button6) else if (event->xbutton.button == Button6)
_glfwInputScroll(window, -1.0, 0.0); _glfwInputScroll(window, -1.0, 0.0);
else if (event->xbutton.button == Button7) else if (event->xbutton.button == Button7)
@ -533,7 +528,6 @@ static void processEvent(XEvent *event)
case ButtonRelease: case ButtonRelease:
{ {
// A mouse button was released
window = findWindow(event->xbutton.window); window = findWindow(event->xbutton.window);
if (window == NULL) if (window == NULL)
return; return;
@ -561,7 +555,6 @@ static void processEvent(XEvent *event)
case EnterNotify: case EnterNotify:
{ {
// The cursor entered the window
window = findWindow(event->xcrossing.window); window = findWindow(event->xcrossing.window);
if (window == NULL) if (window == NULL)
return; return;
@ -575,7 +568,6 @@ static void processEvent(XEvent *event)
case LeaveNotify: case LeaveNotify:
{ {
// The cursor left the window
window = findWindow(event->xcrossing.window); window = findWindow(event->xcrossing.window);
if (window == NULL) if (window == NULL)
return; return;
@ -589,7 +581,6 @@ static void processEvent(XEvent *event)
case MotionNotify: case MotionNotify:
{ {
// The cursor was moved
window = findWindow(event->xmotion.window); window = findWindow(event->xmotion.window);
if (window == NULL) if (window == NULL)
return; return;
@ -627,7 +618,6 @@ static void processEvent(XEvent *event)
case ConfigureNotify: case ConfigureNotify:
{ {
// The window configuration changed somehow
window = findWindow(event->xconfigure.window); window = findWindow(event->xconfigure.window);
if (window == NULL) if (window == NULL)
return; return;
@ -676,7 +666,6 @@ static void processEvent(XEvent *event)
case MapNotify: case MapNotify:
{ {
// The window was mapped
window = findWindow(event->xmap.window); window = findWindow(event->xmap.window);
if (window == NULL) if (window == NULL)
return; return;
@ -688,7 +677,6 @@ static void processEvent(XEvent *event)
case UnmapNotify: case UnmapNotify:
{ {
// The window was unmapped
window = findWindow(event->xmap.window); window = findWindow(event->xmap.window);
if (window == NULL) if (window == NULL)
return; return;
@ -700,7 +688,6 @@ static void processEvent(XEvent *event)
case FocusIn: case FocusIn:
{ {
// The window gained focus
window = findWindow(event->xfocus.window); window = findWindow(event->xfocus.window);
if (window == NULL) if (window == NULL)
return; return;
@ -715,7 +702,6 @@ static void processEvent(XEvent *event)
case FocusOut: case FocusOut:
{ {
// The window lost focus
window = findWindow(event->xfocus.window); window = findWindow(event->xfocus.window);
if (window == NULL) if (window == NULL)
return; return;
@ -730,7 +716,6 @@ static void processEvent(XEvent *event)
case Expose: case Expose:
{ {
// The window's contents was damaged
window = findWindow(event->xexpose.window); window = findWindow(event->xexpose.window);
if (window == NULL) if (window == NULL)
return; return;
@ -741,7 +726,7 @@ static void processEvent(XEvent *event)
case SelectionClear: case SelectionClear:
{ {
// The ownership of the selection was lost // The ownership of the clipboard selection was lost
free(_glfw.x11.selection.string); free(_glfw.x11.selection.string);
_glfw.x11.selection.string = NULL; _glfw.x11.selection.string = NULL;
@ -750,7 +735,7 @@ static void processEvent(XEvent *event)
case SelectionNotify: case SelectionNotify:
{ {
// The selection conversion status is available // The clipboard selection conversion status is available
XSelectionEvent* request = &event->xselection; XSelectionEvent* request = &event->xselection;
@ -764,7 +749,7 @@ static void processEvent(XEvent *event)
case SelectionRequest: case SelectionRequest:
{ {
// The contents of the selection was requested // The contents of the clipboard selection was requested
XSelectionRequestEvent* request = &event->xselectionrequest; XSelectionRequestEvent* request = &event->xselectionrequest;