aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-11-06 23:44:37 +0100
committerChristoph Lohmann <20h@r-36.net>2012-11-06 23:44:37 +0100
commit5d39afc9023bc9a692ba6faf590abf9397a890ae (patch)
treeaa9b1ba8b8fa9461b3c2b8d18c83e6157cbc0ed8 /st.c
parent9df1e56142527de1b8917434093d25212dd9da1e (diff)
downloadst-5d39afc9023bc9a692ba6faf590abf9397a890ae.tar.gz
st-5d39afc9023bc9a692ba6faf590abf9397a890ae.zip
Adding scrollwheel support. Thanks Brandon Invergo!
Diffstat (limited to 'st.c')
-rw-r--r--st.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/st.c b/st.c
index f063029..2ad13ef 100644
--- a/st.c
+++ b/st.c
@@ -673,6 +673,10 @@ bpress(XEvent *e) {
673 sel.mode = 1; 673 sel.mode = 1;
674 sel.ex = sel.bx = x2col(e->xbutton.x); 674 sel.ex = sel.bx = x2col(e->xbutton.x);
675 sel.ey = sel.by = y2row(e->xbutton.y); 675 sel.ey = sel.by = y2row(e->xbutton.y);
676 } else if(e->xbutton.button == Button4) {
677 ttywrite("\031", 1);
678 } else if(e->xbutton.button == Button5) {
679 ttywrite("\005", 1);
676 } 680 }
677} 681}
678 682
@@ -1834,8 +1838,8 @@ tputc(char *c, int len) {
1834 } 1838 }
1835 } 1839 }
1836 /* 1840 /*
1837 * STR sequences must be checked before of anything 1841 * STR sequences must be checked before anything else
1838 * because it can use some control codes as part of the sequence 1842 * because it can use some control codes as part of the sequence.
1839 */ 1843 */
1840 if(term.esc & ESC_STR) { 1844 if(term.esc & ESC_STR) {
1841 switch(ascii) { 1845 switch(ascii) {
@@ -1855,6 +1859,7 @@ tputc(char *c, int len) {
1855 } 1859 }
1856 return; 1860 return;
1857 } 1861 }
1862
1858 /* 1863 /*
1859 * Actions of control codes must be performed as soon they arrive 1864 * Actions of control codes must be performed as soon they arrive
1860 * because they can be embedded inside a control sequence, and 1865 * because they can be embedded inside a control sequence, and
@@ -1895,11 +1900,11 @@ tputc(char *c, int len) {
1895 case '\030': /* CAN */ 1900 case '\030': /* CAN */
1896 csireset(); 1901 csireset();
1897 return; 1902 return;
1898 case '\005': /* ENQ (IGNORED) */ 1903 case '\005': /* ENQ (IGNORED) */
1899 case '\000': /* NUL (IGNORED) */ 1904 case '\000': /* NUL (IGNORED) */
1900 case '\021': /* XON (IGNORED) */ 1905 case '\021': /* XON (IGNORED) */
1901 case '\023': /* XOFF (IGNORED) */ 1906 case '\023': /* XOFF (IGNORED) */
1902 case 0177: /* DEL (IGNORED) */ 1907 case 0177: /* DEL (IGNORED) */
1903 return; 1908 return;
1904 } 1909 }
1905 } else if(term.esc & ESC_START) { 1910 } else if(term.esc & ESC_START) {