add Mod1Mask keybindings b95fb202
Connor Lane Smith · 2012-01-01 20:32 2 file(s) · +88 −19
dmenu.1 +75 −13
33 33
.B dmenu_run
34 34
is a script used by
35 35
.IR dwm (1)
36 -
which lists programs in the user's $PATH and executes the selected item.
36 +
which lists programs in the user's $PATH and runs the result in their $SHELL.
37 37
.SH OPTIONS
38 38
.TP
39 39
.B \-b
73 73
.B \-v
74 74
prints version information to stdout, then exits.
75 75
.SH USAGE
76 -
dmenu is completely controlled by the keyboard.  Besides standard Unix line
77 -
editing and item selection (arrow keys, page up/down, home and end), the
78 -
following keys are recognized:
76 +
dmenu is completely controlled by the keyboard.  Items are selected using the
77 +
arrow keys, page up, page down, home, and end.
79 78
.TP
80 -
.B Tab (Ctrl\-i)
79 +
.B Tab
81 80
Copy the selected item to the input field.
82 81
.TP
83 -
.B Return (Ctrl\-j)
82 +
.B Return
84 83
Confirm selection.  Prints the selected item to stdout and exits, returning
85 84
success.
86 85
.TP
87 -
.B Shift\-Return (Ctrl\-Shift\-j)
86 +
.B Shift\-Return
88 87
Confirm input.  Prints the input text to stdout and exits, returning success.
89 88
.TP
90 -
.B Escape (Ctrl\-c)
89 +
.B Escape
91 90
Exit without selecting an item, returning failure.
92 91
.TP
93 -
.B Ctrl\-y
94 -
Paste the primary X selection into the input field.
92 +
C\-a
93 +
Home
95 94
.TP
96 -
.B Ctrl-Shift-y
97 -
Paste the X clipboard into the input field.
95 +
C\-b
96 +
Left
97 +
.TP
98 +
C\-c
99 +
Escape
100 +
.TP
101 +
C\-d
102 +
Delete
103 +
.TP
104 +
C\-e
105 +
End
106 +
.TP
107 +
C\-f
108 +
Right
109 +
.TP
110 +
C\-h
111 +
Backspace
112 +
.TP
113 +
C\-i
114 +
Tab
115 +
.TP
116 +
C\-j
117 +
Return
118 +
.TP
119 +
C\-k
120 +
Delete line right
121 +
.TP
122 +
C\-m
123 +
Return
124 +
.TP
125 +
C\-n
126 +
Down
127 +
.TP
128 +
C\-p
129 +
Up
130 +
.TP
131 +
C\-u
132 +
Delete line left
133 +
.TP
134 +
C\-w
135 +
Delete word left
136 +
.TP
137 +
C\-y
138 +
Paste from primary X selection
139 +
.TP
140 +
C\-Y
141 +
Paste from X clipboard
142 +
.TP
143 +
M\-g
144 +
Home
145 +
.TP
146 +
M\-G
147 +
End
148 +
.TP
149 +
M\-h
150 +
Page up
151 +
.TP
152 +
M\-j
153 +
Up
154 +
.TP
155 +
M\-k
156 +
Down
157 +
.TP
158 +
M\-l
159 +
Page down
98 160
.SH SEE ALSO
99 161
.IR dwm (1),
100 -
.IR lsx (1)
162 +
.IR stest (1)
dmenu.c +13 −6
243 243
	len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status);
244 244
	if(status == XBufferOverflow)
245 245
		return;
246 -
	if(ev->state & ControlMask) {
247 -
		KeySym lower, upper;
248 -
249 -
		XConvertCase(ksym, &lower, &upper);
250 -
		switch(lower) {
246 +
	if(ev->state & ControlMask)
247 +
		switch(ksym) {
251 248
		case XK_a: ksym = XK_Home;      break;
252 249
		case XK_b: ksym = XK_Left;      break;
253 250
		case XK_c: ksym = XK_Escape;    break;
281 278
		default:
282 279
			return;
283 280
		}
284 -
	}
281 +
	else if(ev->state & Mod1Mask)
282 +
		switch(ksym) {
283 +
		case XK_g: ksym = XK_Home;  break;
284 +
		case XK_G: ksym = XK_End;   break;
285 +
		case XK_h: ksym = XK_Prior; break;
286 +
		case XK_j: ksym = XK_Up;    break;
287 +
		case XK_k: ksym = XK_Down;  break;
288 +
		case XK_l: ksym = XK_Next;  break;
289 +
		default:
290 +
			return;
291 +
		}
285 292
	switch(ksym) {
286 293
	default:
287 294
		if(!iscntrl(*buf))