A cross-platform procedure to obtain the double click time:Polo wrote:If it's not possible, then a function to get the doubleclick time (like GetDoubleClickTime_() but crossplatform)
Code: Select all
EnableExplicit
CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
ImportC ""
GetDblTime()
EndImport
CompilerEndIf
Procedure.I GetDoubleClickTime()
Protected DoubleClickTime.I
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Linux
Protected GValue.GValue
Protected *Settings.GtkSettings
GValue\g_type = 6 << 2
*Settings = gtk_settings_get_default_()
If *Settings
g_object_get_property_(*Settings, "gtk-double-click-time", @GValue)
EndIf
DoubleClickTime = g_value_get_int_(@GValue)
CompilerCase #PB_OS_MacOS
DoubleClickTime = Int(GetDblTime() * 16.666667)
CompilerCase #PB_OS_Windows
DoubleClickTime = GetDoubleClickTime_()
CompilerEndSelect
ProcedureReturn DoubleClickTime
EndProcedure
MessageRequester("Info", "Double click time = " + Str(GetDoubleClickTime()) + " ms")