[WIP] Respect the default system click_interval
This commit is contained in:
parent
70c9c058e2
commit
382367506a
2 changed files with 16 additions and 1 deletions
|
|
@ -267,6 +267,12 @@ + (GlobalMenuTarget *) shared_instance
|
|||
return Py_BuildValue("s", [locale UTF8String]);
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
cocoa_get_double_click_interval(PyObject UNUSED *self) {
|
||||
double interval = [NSEvent doubleClickInterval];
|
||||
return Py_BuildValue("f", interval);
|
||||
}
|
||||
|
||||
void
|
||||
cocoa_set_hide_from_tasks(void) {
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
|
||||
|
|
@ -300,6 +306,7 @@ + (GlobalMenuTarget *) shared_instance
|
|||
|
||||
static PyMethodDef module_methods[] = {
|
||||
{"cocoa_get_lang", (PyCFunction)cocoa_get_lang, METH_NOARGS, ""},
|
||||
{"cocoa_get_double_click_interval", (PyCFunction)cocoa_get_double_click_interval, METH_NOARGS, ""},
|
||||
{"cocoa_set_new_window_trigger", (PyCFunction)cocoa_set_new_window_trigger, METH_VARARGS, ""},
|
||||
{NULL, NULL, 0, NULL} /* Sentinel */
|
||||
};
|
||||
|
|
|
|||
|
|
@ -399,7 +399,15 @@ def url_style(x):
|
|||
any character that is marked as an alpha-numeric character in the unicode
|
||||
database will be matched.'''))
|
||||
|
||||
o('click_interval', 0.5, option_type=positive_float, long_text=_('''
|
||||
|
||||
def click_interval(x):
|
||||
if x == 'system':
|
||||
from .fast_data_types import cocoa_get_double_click_interval
|
||||
return cocoa_get_double_click_interval()
|
||||
return positive_float(x)
|
||||
|
||||
|
||||
o('click_interval', 'system', option_type=click_interval, long_text=_('''
|
||||
The interval between successive clicks to detect
|
||||
double/triple clicks (in seconds)'''))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue