fix #264 -- system defined doubleclick time

This commit is contained in:
Vadim Lopatin 2016-05-18 15:31:43 +03:00
parent 8a7fec4674
commit 5f6c0ddf3e
5 changed files with 12 additions and 3 deletions

View File

@ -717,6 +717,9 @@ ushort mouseButtonToFlag(MouseButton btn) {
} }
} }
/// double click max interval, milliseconds; may be changed by platform
__gshared long DOUBLE_CLICK_THRESHOLD_MS = 300;
/// Mouse button state details for MouseEvent /// Mouse button state details for MouseEvent
struct ButtonDetails { struct ButtonDetails {
/// Clock.currStdTime() for down event of this button (0 if button is up). /// Clock.currStdTime() for down event of this button (0 if button is up).
@ -737,7 +740,6 @@ struct ButtonDetails {
return _doubleClick; return _doubleClick;
} }
static long DOUBLE_CLICK_THRESHOLD_MS = 200;
void reset() { void reset() {

View File

@ -162,9 +162,9 @@ struct EmbeddedResourceList {
__gshared EmbeddedResourceList embeddedResourceList; __gshared EmbeddedResourceList embeddedResourceList;
// immutable string test_res = import("res/background.xml"); //immutable string test_res = import("res/background.xml");
// Unfortunately, import with full pathes does not work on Windows // Unfortunately, import with full pathes does not work on Windows
// version = USE_FULL_PATH_FOR_RESOURCES; //version = USE_FULL_PATH_FOR_RESOURCES;
EmbeddedResource[] embedResource(string resourceName)() { EmbeddedResource[] embedResource(string resourceName)() {
version (USE_FULL_PATH_FOR_RESOURCES) { version (USE_FULL_PATH_FOR_RESOURCES) {

View File

@ -395,3 +395,5 @@ version(unittest) {
} }
} }
} }

View File

@ -1723,6 +1723,10 @@ int sdlmain(string[] args) {
} }
initResourceManagers(); initResourceManagers();
version (Windows) {
DOUBLE_CLICK_THRESHOLD_MS = GetDoubleClickTime();
}
currentTheme = createDefaultTheme(); currentTheme = createDefaultTheme();
try { try {

View File

@ -1126,6 +1126,7 @@ int myWinMain(void* hInstance, void* hPrevInstance, char* lpCmdLine, int iCmdSho
} }
Platform.setInstance(w32platform); Platform.setInstance(w32platform);
DOUBLE_CLICK_THRESHOLD_MS = GetDoubleClickTime();
Log.v("Initializing font manager"); Log.v("Initializing font manager");
if (!initFontManager()) { if (!initFontManager()) {