[event.c] Add typo in buttonpress

This commit is contained in:
Martin Duquesnoy
2008-09-29 21:30:58 +02:00
parent bb89bba313
commit dc517b28c9

117
event.c
View File

@@ -48,35 +48,47 @@ buttonpress(XEvent ev)
/* ******** */ /* ******** */
/* TITLEBAR */ /* TITLEBAR */
/* ******** */ /* ******** */
{
if((c = gettbar(ev.xbutton.window))) if((c = gettbar(ev.xbutton.window)))
{ {
raiseclient(c); raiseclient(c);
/* BUTTON 1 */ /* BUTTON 1 */
{
if(ev.xbutton.button == Button1) if(ev.xbutton.button == Button1)
mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Move); mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Move);
}
/* BUTTON 2 */ /* BUTTON 2 */
else if(ev.xbutton.button == Button2) {
{ if(ev.xbutton.button == Button2)
if(tags[seltag].layout.func == tile) {
tile_switch(NULL); if(tags[seltag].layout.func == tile)
else tile_switch(NULL);
togglemax(NULL); else
} togglemax(NULL);
}
}
/* BUTTON 3 */ /* BUTTON 3 */
else if(ev.xbutton.button == Button3) {
mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Resize); if(ev.xbutton.button == Button3)
mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Resize);
}
} }
}
/* ***************** */ /* ***************** */
/* TITLEBAR'S BUTTON */ /* TITLEBAR'S BUTTON */
/* ***************** */ /* ***************** */
else if((c = getbutton(ev.xbutton.window))) {
if((c = getbutton(ev.xbutton.window)))
{ {
/* BUTTON 1 */ /* BUTTON 1 */
{
if(ev.xbutton.button == Button1) if(ev.xbutton.button == Button1)
killclient(NULL); killclient(NULL);
}
/* BUTTON 2 AND 3 */ /* BUTTON 2 AND 3 */
else if(ev.xbutton.button == Button2 {
if(ev.xbutton.button == Button2
|| ev.xbutton.button == Button3) || ev.xbutton.button == Button3)
{ {
if(tags[seltag].layout.func == tile) if(tags[seltag].layout.func == tile)
@@ -84,30 +96,41 @@ buttonpress(XEvent ev)
else else
togglemax(NULL); togglemax(NULL);
} }
}
} }
}
} }
/* ****** */ /* ****** */
/* CLIENT */ /* CLIENT */
/* ****** */ /* ****** */
{
if((c = getclient(ev.xbutton.window))) if((c = getclient(ev.xbutton.window)))
{ {
raiseclient(c); raiseclient(c);
/* BUTTON 1 */ /* BUTTON 1 */
{
if(ev.xbutton.button == Button1) if(ev.xbutton.button == Button1)
mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Move); mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Move);
}
/* BUTTON 2 */ /* BUTTON 2 */
else if(ev.xbutton.button == Button2) {
{ if(ev.xbutton.button == Button2)
if(tags[seltag].layout.func == tile) {
tile_switch(NULL); if(tags[seltag].layout.func == tile)
else tile_switch(NULL);
togglemax(NULL); else
} togglemax(NULL);
}
}
/* BUTTON 3 */ /* BUTTON 3 */
else if(ev.xbutton.button == Button3) {
mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Resize); if(ev.xbutton.button == Button3)
mouseaction(c, ev.xbutton.x_root, ev.xbutton.y_root, Resize);
}
} }
}
/* *** */ /* *** */
/* BAR */ /* BAR */
@@ -128,11 +151,15 @@ buttonpress(XEvent ev)
{ {
ITOA(s, i); ITOA(s, i);
/* BUTTON 1 */ /* BUTTON 1 */
{
if(ev.xbutton.button == Button1) if(ev.xbutton.button == Button1)
tag(s); tag(s);
}
/* BUTTON 2 */ /* BUTTON 2 */
else if(ev.xbutton.button == Button3) {
if(ev.xbutton.button == Button3)
tagtransfert(s); tagtransfert(s);
}
} }
} }
} }
@@ -142,11 +169,15 @@ buttonpress(XEvent ev)
if(ev.xbutton.x < taglen[conf.ntag]) if(ev.xbutton.x < taglen[conf.ntag])
{ {
/* BUTTON 4 (UP) */ /* BUTTON 4 (UP) */
{
if(ev.xbutton.button == Button4) if(ev.xbutton.button == Button4)
tag("+1"); tag("+1");
}
/* BUTTON 5 (UP) */ /* BUTTON 5 (UP) */
else if (ev.xbutton.button == Button5) {
if (ev.xbutton.button == Button5)
tag("-1"); tag("-1");
}
} }
} }
} }
@@ -160,13 +191,17 @@ buttonpress(XEvent ev)
TEXTW(tags[seltag].layout.symbol) - 3) TEXTW(tags[seltag].layout.symbol) - 3)
{ {
/* BUTTON 1 / 4 */ /* BUTTON 1 / 4 */
{
if(ev.xbutton.button == Button1 if(ev.xbutton.button == Button1
|| ev.xbutton.button == Button4) || ev.xbutton.button == Button4)
layoutswitch("+"); layoutswitch("+");
}
/* BUTTON 3 / 5 */ /* BUTTON 3 / 5 */
else if(ev.xbutton.button == Button3 {
|| ev.xbutton.button == Button5) if(ev.xbutton.button == Button3
|| ev.xbutton.button == Button5)
layoutswitch("-"); layoutswitch("-");
}
} }
} }
} }
@@ -178,10 +213,16 @@ buttonpress(XEvent ev)
{ {
if(ev.xbutton.window == root) if(ev.xbutton.window == root)
{ {
if(ev.xbutton.button == Button4) /* BUTTON 4 */
tag("+1"); {
else if(ev.xbutton.button == Button5) if(ev.xbutton.button == Button4)
tag("+1");
}
/* BUTTON 5 */
{
if(ev.xbutton.button == Button5)
tag("-1"); tag("-1");
}
} }
} }
@@ -381,17 +422,17 @@ getevent(void)
{ {
switch (event.type) switch (event.type)
{ {
case ButtonPress: buttonpress(event); break; case ButtonPress: buttonpress(event); break;
case ConfigureRequest: configurerequest(event); break; case ConfigureRequest: configurerequest(event); break;
case DestroyNotify: destroynotify(event); break; case DestroyNotify: destroynotify(event); break;
case EnterNotify: enternotify(event); break; case EnterNotify: enternotify(event); break;
case Expose: expose(event); break; case Expose: expose(event); break;
case FocusIn: focusin(event); break; case FocusIn: focusin(event); break;
case KeyPress: keypress(event); break; case KeyPress: keypress(event); break;
case MapRequest: maprequest(event); break; case MapRequest: maprequest(event); break;
case MappingNotify: mapnotify(event); break; case MappingNotify: mapnotify(event); break;
case PropertyNotify: propertynotify(event); break; case PropertyNotify: propertynotify(event); break;
case UnmapNotify: unmapnotify(event); break; case UnmapNotify: unmapnotify(event); break;
} }
return; return;