about summary refs log tree commit diff stats
path: root/WWW/Library
Commit message (Expand)AuthorAgeFilesLines
...
* snapshot of project "lynx", label v2-8-1dev_19Thomas E. Dickey1998-07-313-10/+4
* snapshot of project "lynx", label v2-8-1dev_18Thomas E. Dickey1998-07-2514-60/+70
* snapshot of project "lynx", label v2-8-1dev_17Thomas E. Dickey1998-06-2525-132/+41
* snapshot of project "lynx", label v2-8-1dev_14Thomas E. Dickey1998-06-0413-149/+88
* snapshot of project "lynx", label v2-8-1dev_13Thomas E. Dickey1998-05-243-118/+122
* snapshot of project "lynx", label v2-8-1dev_11Thomas E. Dickey1998-05-143-10/+11
* snapshot of project "lynx", label v2-8-1dev_10Thomas E. Dickey1998-05-1110-94/+56
* snapshot of project "lynx", label v2-8-1dev_9Thomas E. Dickey1998-05-037-18/+20
* snapshot of project "lynx", label v2-8-1dev_8Thomas E. Dickey1998-05-0212-140/+79
* snapshot of project "lynx", label v2-8-1dev_7Thomas E. Dickey1998-04-2336-1754/+941
* snapshot of project "lynx", label v2-8-1dev_6Thomas E. Dickey1998-04-184-24/+76
* snapshot of project "lynx", label v2-8-1dev_5Thomas E. Dickey1998-03-29104-1490/+1251
* snapshot of project "lynx", label v2-8-1dev_3Thomas E. Dickey1998-03-212-2/+59
* snapshot of project "lynx", label v2-8-1dev_2Thomas E. Dickey1998-03-1827-2153/+40
* snapshot of project "lynx", label v2-8pre_4Thomas E. Dickey1998-03-063-11/+7
* snapshot of project "lynx", label v2-8pre_3Thomas E. Dickey1998-03-041-7/+7
* snapshot of project "lynx", label v2-8pre_2Thomas E. Dickey1998-02-2829-56/+1555
* snapshot of project "lynx", label v2-7-1ac-0_117Thomas E. Dickey1998-02-2725-766/+550
* snapshot of project "lynx", label v2-7-1ac-0_115Thomas E. Dickey1998-02-1932-3198/+1297
* snapshot of project "lynx", label v2-7-1ac-0_114Thomas E. Dickey1998-02-139-755/+660
* snapshot of project "lynx", label v2-7-1ac-0_113Thomas E. Dickey1998-02-0530-5165/+6366
* snapshot of project "lynx", label v2-7-1ac-0_111Thomas E. Dickey1998-01-2816-608/+17
* snapshot of project "lynx", label v2-7-1ac_0-110Thomas E. Dickey1998-01-2255-390/+2405
* snapshot of project "lynx", label v2-7-1ac_0-106Thomas E. Dickey1998-01-0524-2019/+0
* snapshot of project "lynx", label v2-7-1ac_0-105Thomas E. Dickey1998-01-026-114/+182
* snapshot of project "lynx", label v2-7-1ac_0-102Thomas E. Dickey1997-12-185-17/+15
* snapshot of project "lynx", label v2-7-1ac_0-97Thomas E. Dickey1997-11-2414-149/+506
* snapshot of project "lynx", label v2-7-1ac_0-95Thomas E. Dickey1997-11-1717-308/+698
* snapshot of project "lynx", label v2-7-1ac_0-93Thomas E. Dickey1997-11-0711-117/+381
* snapshot of project "lynx", label v2-7-1ac_0-89Thomas E. Dickey1997-10-2714-72/+910
* snapshot of project "lynx", label v2-7-1ac_0-84Thomas E. Dickey1997-10-1719-138/+559
* snapshot of project "lynx", label v2-7-1ac_0-76Thomas E. Dickey1997-10-0633-439/+918
* snapshot of project "lynx", label v2-7-1ac_0-69Thomas E. Dickey1997-09-1918-132/+154
* snapshot of project "lynx", label v2-7-1ac_0-68Thomas E. Dickey1997-09-189-41/+36
* snapshot of project "lynx", label v2-7-1ac_0-67Thomas E. Dickey1997-09-162-4/+4
* snapshot of project "lynx", label v2-7-1ac_0-64Thomas E. Dickey1997-09-1213-59/+271
* snapshot of project "lynx", label v2-7-1ac_0-60Thomas E. Dickey1997-09-062-12/+25
* snapshot of project "lynx", label v2-7-1ac_0-58Thomas E. Dickey1997-09-031-0/+1
* snapshot of project "lynx", label v2-7-1ac_0-55Thomas E. Dickey1997-08-273-9/+14
* snapshot of project "lynx", label v2-7-1ac_0-52Thomas E. Dickey1997-08-1714-134/+982
* snapshot of project "lynx", label v2-7-1ac_0-48Thomas E. Dickey1997-08-071-4/+4
* snapshot of project "lynx", label v2-7-1ac_0-47Thomas E. Dickey1997-08-073-382/+390
* snapshot of project "lynx", label v2-7-1ac_0-46Thomas E. Dickey1997-08-076-32/+104
* snapshot of project "lynx", label v2-7-1ac_0-45Thomas E. Dickey1997-08-035-12/+71
* snapshot of project "lynx", label v2-7-1ac_0-43Thomas E. Dickey1997-07-284-8/+9
* snapshot of project "lynx", label v2-7-1ac_0-42Thomas E. Dickey1997-07-272-1/+2
* snapshot of project "lynx", label v2-7-1ac_0-38Thomas E. Dickey1997-07-223-5/+10
* snapshot of project "lynx", label v2-7-1ac_0-36Thomas E. Dickey1997-07-1825-775/+1487
* snapshot of project "lynx", label v2-7-1ac_0-28Thomas E. Dickey1997-05-2519-312/+1439
* snapshot of project "lynx", label v2-7-1ac_0-6Thomas E. Dickey1997-04-1639-247/+2471
suckless/dwm/blame/mouse.c?h=1.8&id=7e433694ffa59c5b47f216409d5fd2d68b77742e'>^
b9da4b0 ^


3f942f9 ^

48b6e9a ^
b9da4b0 ^


b9da4b0 ^
dfd84f9 ^
b9da4b0 ^

dfd84f9 ^


b9da4b0 ^
dfd84f9 ^
3f942f9 ^

da2bbd3 ^
b9da4b0 ^

b9da4b0 ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148

                                                              


                                        
                
 


                   
                       
 


                                 
                                                                      


                                                               
                                        

                    

                                                    



                                                      
                                        











                                                                

                                                      





























                                                                                          
                                                         


                               



                                                             



                  
                     
 

                   
                                                                                  

                                                                                     
                                                                
                 
                                                               

                                 


                                             
                                  
                                    



                                                                        
                                  











                                                         
                                 


                         

                   
                                                                                  


                                                                                   
                 
                                                               

                                  


                                             
                                  
                                    

                                                         
                                  

                                   




                                                         
/*
 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
 * See LICENSE file for license details.
 */

#include "dwm.h"

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <X11/keysym.h>

/********** CUSTOMIZE **********/

const char *term[] = { 
	"urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-fn",
	"-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL
};
const char *browse[] = { "firefox", NULL };
const char *xlock[] = { "xlock", NULL };

static Key key[] = {
	{ Mod1Mask, XK_Return, zoom, { 0 } },
	{ Mod1Mask, XK_t, spawn, { .argv = term } },
	{ Mod1Mask, XK_w, spawn, { .argv = browse } },
	{ Mod1Mask, XK_l, spawn, { .argv = xlock } },
	{ Mod1Mask, XK_k, prevc, { 0 } },
	{ Mod1Mask, XK_j, nextc, { 0 } }, 
	{ Mod1Mask, XK_m, max, { 0 } }, 
	{ Mod1Mask, XK_0, view, { .i = Tscratch } }, 
	{ Mod1Mask, XK_1, view, { .i = Tdev } }, 
	{ Mod1Mask, XK_2, view, { .i = Tirc } }, 
	{ Mod1Mask, XK_3, view, { .i = Twww } }, 
	{ Mod1Mask, XK_4, view, { .i = Twork } }, 
	{ Mod1Mask, XK_space, tiling, { 0 } }, 
	{ Mod1Mask | ShiftMask, XK_space, floating, { 0 } }, 
	{ Mod1Mask | ShiftMask, XK_0, tag, { .i = Tscratch } }, 
	{ Mod1Mask | ShiftMask, XK_1, tag, { .i = Tdev } }, 
	{ Mod1Mask | ShiftMask, XK_2, tag, { .i = Tirc } }, 
	{ Mod1Mask | ShiftMask, XK_3, tag, { .i = Twww } }, 
	{ Mod1Mask | ShiftMask, XK_4, tag, { .i = Twork } }, 
	{ Mod1Mask | ShiftMask, XK_c, ckill, { 0 } }, 
	{ Mod1Mask | ShiftMask, XK_q, quit, { 0 } },
};

/********** CUSTOMIZE **********/

void
update_keys(void)
{
	unsigned int i, len;
	KeyCode code;

	len = sizeof(key) / sizeof(key[0]);
	for(i = 0; i < len; i++) {
		code = XKeysymToKeycode(dpy, key[i].keysym);
		XUngrabKey(dpy, code, key[i].mod, root);
		XGrabKey(dpy, code, key[i].mod, root, True, GrabModeAsync, GrabModeAsync);
	}
}

void
keypress(XEvent *e)
{
	XKeyEvent *ev = &e->xkey;
	unsigned int i, len;
	KeySym keysym;

	keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
	len = sizeof(key) / sizeof(key[0]);
	for(i = 0; i < len; i++)
		if((keysym == key[i].keysym) && (key[i].mod == ev->state)) {
			if(key[i].func)
				key[i].func(&key[i].arg);
			return;
		}
}

#define ButtonMask      (ButtonPressMask | ButtonReleaseMask)
#define MouseMask       (ButtonMask | PointerMotionMask)

void
mresize(Client *c)
{
	XEvent ev;
	int ocx, ocy;

	ocx = c->x;
	ocy = c->y;
	if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
				None, cursor[CurResize], CurrentTime) != GrabSuccess)
		return;
	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h);
	for(;;) {
		XMaskEvent(dpy, MouseMask | ExposureMask, &ev);
		switch(ev.type) {
		default: break;
		case Expose:
			handler[Expose](&ev);
			break;
		case MotionNotify:
			XFlush(dpy);
			c->w = abs(ocx - ev.xmotion.x);
			c->h = abs(ocy - ev.xmotion.y);
			c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w;
			c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h;
			resize(c);
			break;
		case ButtonRelease:
			XUngrabPointer(dpy, CurrentTime);
			return;
		}
	}
}

void
mmove(Client *c)
{
	XEvent ev;
	int x1, y1, ocx, ocy, di;
	unsigned int dui;
	Window dummy;

	ocx = c->x;
	ocy = c->y;
	if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
				None, cursor[CurMove], CurrentTime) != GrabSuccess)
		return;
	XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui);
	for(;;) {
		XMaskEvent(dpy, MouseMask | ExposureMask, &ev);
		switch (ev.type) {
		default: break;
		case Expose:
			handler[Expose](&ev);
			break;
		case MotionNotify:
			XFlush(dpy);
			c->x = ocx + (ev.xmotion.x - x1);
			c->y = ocy + (ev.xmotion.y - y1);
			resize(c);
			break;
		case ButtonRelease:
			XUngrabPointer(dpy, CurrentTime);
			return;
		}
	}
}