Lines Matching refs:tap
228 } tap; member
697 return (timespeccmp(&ts, &tp->tap.maxtime, <)); in wstpad_is_tap()
710 if (IS_MT(tp) || tp->tap.contacts == 1) { in wstpad_tap_filter()
715 tp->tap.valid = (CENTERED(t) && dist <= (tp->tap.maxdist << 12)); in wstpad_tap_filter()
734 if (tp->tap.state == TAP_DETECT && !tp->tap.valid) in wstpad_tap_touch()
743 if (tp->tap.state == TAP_DETECT && !tp->tap.valid) in wstpad_tap_touch()
755 int n = tp->tap.contacts - tp->contacts - 1; in wstpad_tap_button()
757 tp->tap.masked = tp->contacts; in wstpad_tap_button()
759 return (n >= 0 && n < TAP_BTNMAP_SIZE ? tp->tap.btnmap[n] : 0); in wstpad_tap_button()
769 return ((tp->tap.button || tp->tap.pending) && tp->tap.masked == 0); in tap_unmask()
795 tp->tap.contacts = 0; in wstpad_tap()
800 tp->tap.contacts = tp->contacts; in wstpad_tap()
801 tp->tap.valid = 0; in wstpad_tap()
815 switch (tp->tap.state) { in wstpad_tap()
822 if (tp->tap.button) in wstpad_tap()
824 tp->tap.pending = (tp->tap.valid in wstpad_tap()
826 if (tp->tap.pending) { in wstpad_tap()
827 tp->tap.state = TAP_LIFTED; in wstpad_tap()
828 err = !timeout_add_msec(&tp->tap.to, in wstpad_tap()
831 } else if (!is_tap && tp->tap.locktime == 0) { in wstpad_tap()
832 if (contacts == 0 && tp->tap.button) in wstpad_tap()
835 tp->tap.state = TAP_IGNORE; in wstpad_tap()
836 } else if (!is_tap && tp->tap.button) { in wstpad_tap()
838 tp->tap.state = TAP_LOCKED; in wstpad_tap()
839 err = !timeout_add_msec(&tp->tap.to, in wstpad_tap()
840 tp->tap.locktime); in wstpad_tap()
842 tp->tap.state = TAP_LOCKED_DRAG; in wstpad_tap()
849 tp->tap.state = TAP_DETECT; in wstpad_tap()
850 if (tp->tap.button) in wstpad_tap()
856 timeout_del(&tp->tap.to); in wstpad_tap()
857 tp->tap.state = TAP_DETECT; in wstpad_tap()
858 if (tp->tap.pending) in wstpad_tap()
864 timeout_del(&tp->tap.to); in wstpad_tap()
865 tp->tap.state = TAP_LOCKED_DRAG; in wstpad_tap()
874 tp->tap.state = TAP_DETECT; in wstpad_tap()
876 tp->tap.state = TAP_LOCKED; in wstpad_tap()
877 err = !timeout_add_msec(&tp->tap.to, in wstpad_tap()
878 tp->tap.locktime); in wstpad_tap()
885 input->sbtn.buttons &= ~tp->tap.button; in wstpad_tap()
886 input->sbtn.sync |= tp->tap.button; in wstpad_tap()
887 tp->tap.pending = 0; in wstpad_tap()
888 tp->tap.button = 0; in wstpad_tap()
889 tp->tap.state = TAP_DETECT; in wstpad_tap()
897 return ((tp->tap.button & (input->btn.buttons | tp->softbutton)) == 0 in wstpad_tap_sync()
898 || (tp->tap.button == PRIMARYBTN && tp->softbutton)); in wstpad_tap_sync()
914 if (tp->tap.pending) { in wstpad_tap_timeout()
915 tp->tap.button = tp->tap.pending; in wstpad_tap_timeout()
916 tp->tap.pending = 0; in wstpad_tap_timeout()
917 input->sbtn.buttons |= tp->tap.button; in wstpad_tap_timeout()
918 timeout_add_msec(&tp->tap.to, tp->tap.clicktime); in wstpad_tap_timeout()
921 btn = ffs(tp->tap.button) - 1; in wstpad_tap_timeout()
926 btn = ffs(tp->tap.button) - 1; in wstpad_tap_timeout()
928 if (tp->tap.button != tp->softbutton) in wstpad_tap_timeout()
929 input->sbtn.buttons &= ~tp->tap.button; in wstpad_tap_timeout()
930 tp->tap.button = 0; in wstpad_tap_timeout()
931 tp->tap.state = TAP_DETECT; in wstpad_tap_timeout()
950 input->sbtn.sync |= tp->tap.button; in wstpad_tap_timeout()
987 if (tp->softbutton != tp->tap.button) in wstpad_cmds()
992 if (tp->softbutton != tp->tap.button) { in wstpad_cmds()
999 if (tp->tap.button) in wstpad_cmds()
1000 input->btn.sync &= ~tp->tap.button; in wstpad_cmds()
1003 tp->tap.button = tp->tap.pending; in wstpad_cmds()
1004 tp->tap.pending = 0; in wstpad_cmds()
1005 input->sbtn.buttons |= tp->tap.button; in wstpad_cmds()
1007 input->sbtn.sync |= tp->tap.button; in wstpad_cmds()
1010 if (tp->tap.button != tp->softbutton) in wstpad_cmds()
1011 input->sbtn.buttons &= ~tp->tap.button; in wstpad_cmds()
1013 input->sbtn.sync |= tp->tap.button; in wstpad_cmds()
1014 tp->tap.button = 0; in wstpad_cmds()
1506 timeout_set(&tp->tap.to, wstpad_tap_timeout, input); in wstpad_init()
1634 tp->tap.maxtime.tv_nsec = TAP_MAXTIME_DEFAULT * 1000000; in wstpad_configure()
1635 tp->tap.clicktime = TAP_CLICKTIME_DEFAULT; in wstpad_configure()
1636 tp->tap.locktime = TAP_LOCKTIME_DEFAULT; in wstpad_configure()
1640 tp->tap.maxdist = 4 * h_unit; in wstpad_configure()
1694 if (tp->tap.btnmap[i] == 0) in wstpad_configure()
1697 tp->tap.clicktime = imin(imax(tp->tap.clicktime, 80), 350); in wstpad_configure()
1698 if (tp->tap.locktime) in wstpad_configure()
1699 tp->tap.locktime = in wstpad_configure()
1700 imin(imax(tp->tap.locktime, 150), 5000); in wstpad_configure()
1720 timeout_del(&tp->tap.to); in wstpad_reset()
1721 tp->tap.state = TAP_DETECT; in wstpad_reset()
1736 timeout_del(&tp->tap.to); in wstpad_cleanup()
1816 tp->tap.maxtime.tv_nsec = imin(val, 999) * 1000000; in wstpad_set_param()
1819 tp->tap.clicktime = val; in wstpad_set_param()
1822 tp->tap.locktime = val; in wstpad_set_param()
1825 tp->tap.btnmap[0] = BTNMASK(val); in wstpad_set_param()
1828 tp->tap.btnmap[1] = BTNMASK(val); in wstpad_set_param()
1831 tp->tap.btnmap[2] = BTNMASK(val); in wstpad_set_param()
1914 *pval = tp->tap.maxtime.tv_nsec / 1000000; in wstpad_get_param()
1917 *pval = tp->tap.clicktime; in wstpad_get_param()
1920 *pval = tp->tap.locktime; in wstpad_get_param()
1923 *pval = ffs(tp->tap.btnmap[0]); in wstpad_get_param()
1926 *pval = ffs(tp->tap.btnmap[1]); in wstpad_get_param()
1929 *pval = ffs(tp->tap.btnmap[2]); in wstpad_get_param()