+
+ else if(b == 1) {
+ /* double click to select word */
+ struct timeval now;
+ gettimeofday(&now, NULL);
+
+ if(TIMEDIFFERENCE(now, sel.tclick1) <= DOUBLECLICK_TIMEOUT) {
+ sel.bx = sel.ex;
+ while(term.line[sel.ey][sel.bx-1].state & GLYPH_SET &&
+ term.line[sel.ey][sel.bx-1].c[0] != ' ') sel.bx--;
+ sel.b.x = sel.bx;
+ while(term.line[sel.ey][sel.ex+1].state & GLYPH_SET &&
+ term.line[sel.ey][sel.ex+1].c[0] != ' ') sel.ex++;
+ sel.e.x = sel.ex;
+ sel.b.y = sel.e.y = sel.ey;
+ selcopy();
+ }
+
+ /* triple click on the line */
+ if(TIMEDIFFERENCE(now, sel.tclick2) <= TRIPLECLICK_TIMEOUT) {
+ sel.b.x = sel.bx = 0;
+ sel.e.x = sel.ex = term.col;
+ sel.b.y = sel.e.y = sel.ey;
+ selcopy();
+ }
+ }