Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
K'van
Tales of MajEyal
Commits
6b0c24a0
Commit
6b0c24a0
authored
10 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
fix double-keyboard key bug on windows
parent
5c82a645
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
game/engines/default/modules/boot/dialogs/MainMenu.lua
+1
-1
1 addition, 1 deletion
game/engines/default/modules/boot/dialogs/MainMenu.lua
src/main.c
+13
-1
13 additions, 1 deletion
src/main.c
src/web.c
+4
-1
4 additions, 1 deletion
src/web.c
with
18 additions
and
3 deletions
game/engines/default/modules/boot/dialogs/MainMenu.lua
+
1
−
1
View file @
6b0c24a0
...
...
@@ -65,7 +65,7 @@ function _M:init()
d
.
__showup
=
nil
tween
(
1
,
{
a
=
1
},
{
a
=
2
},
'linear'
,
function
()
game
:
unregisterDialog
(
d
)
if
i
<
500
then
i
=
i
+
1
return
fct
()
end
if
i
<
500
then
i
=
i
+
1
return
fct
()
else
core
.
game
.
exit_engine
()
end
end
)
end
fct
()
...
...
This diff is collapsed.
Click to expand it.
src/main.c
+
13
−
1
View file @
6b0c24a0
...
...
@@ -297,6 +297,14 @@ void on_event(SDL_Event *event)
case
SDL_TEXTINPUT
:
if
(
current_keyhandler
!=
LUA_NOREF
)
{
static
Uint32
lastts
=
0
;
static
char
lastc
=
0
;
if
(
event
->
text
.
timestamp
==
lastts
)
break
;
if
((
event
->
text
.
timestamp
-
lastts
<
5
)
&&
(
lastc
==
event
->
text
.
text
[
0
]))
break
;
lastts
=
event
->
text
.
timestamp
;
lastc
=
event
->
text
.
text
[
0
];
printf
(
"<==text event %ld : '%s'
\n
"
,
(
long
int
)
event
->
text
.
timestamp
,
event
->
text
.
text
);
lua_rawgeti
(
L
,
LUA_REGISTRYINDEX
,
current_keyhandler
);
lua_pushstring
(
L
,
"receiveKey"
);
lua_gettable
(
L
,
-
2
);
...
...
@@ -313,8 +321,10 @@ void on_event(SDL_Event *event)
lua_pushstring
(
L
,
event
->
text
.
text
);
lua_pushboolean
(
L
,
FALSE
);
lua_pushnil
(
L
);
lua_pushnil
(
L
);
lua_pushnumber
(
L
,
0
);
docall
(
L
,
9
,
0
);
docall
(
L
,
11
,
0
);
}
break
;
case
SDL_KEYDOWN
:
...
...
@@ -1232,6 +1242,7 @@ int main(int argc, char *argv[])
if
(
!
strncmp
(
arg
,
"--home"
,
6
))
override_home
=
strdup
(
argv
[
++
i
]);
if
(
!
strncmp
(
arg
,
"--no-steam"
,
10
))
no_steam
=
TRUE
;
if
(
!
strncmp
(
arg
,
"--type=zygote"
,
13
))
is_zygote
=
TRUE
;
if
(
!
strncmp
(
arg
,
"--type=renderer"
,
15
))
is_zygote
=
TRUE
;
}
#ifdef SELFEXE_WINDOWS
...
...
@@ -1493,6 +1504,7 @@ int main(int argc, char *argv[])
}
// Clean up locks.
printf
(
"Cleaning up!
\n
"
);
cleanupTimerLock
(
renderingLock
,
&
display_timer_id
,
&
redraw_pending
);
cleanupTimerLock
(
realtimeLock
,
&
realtime_timer_id
,
&
realtime_pending
);
...
...
This diff is collapsed.
Click to expand it.
src/web.c
+
4
−
1
View file @
6b0c24a0
...
...
@@ -297,6 +297,7 @@ static void handle_event(WebEvent *event) {
break
;
case
TE4_WEB_EVENT_DOWNLOAD_REQUEST
:
printf
(
"[WEBCORE] download request %ld = %s :: %s :: %s
\n
"
,
event
->
data
.
download_request
.
id
,
event
->
data
.
download_request
.
url
,
event
->
data
.
download_request
.
name
,
event
->
data
.
download_request
.
mime
);
lua_rawgeti
(
he_L
,
LUA_REGISTRYINDEX
,
event
->
handlers
);
lua_pushstring
(
he_L
,
"on_download_request"
);
lua_gettable
(
he_L
,
-
2
);
...
...
@@ -311,6 +312,7 @@ static void handle_event(WebEvent *event) {
break
;
case
TE4_WEB_EVENT_DOWNLOAD_UPDATE
:
printf
(
"[WEBCORE] download update %ld = %ld :: %ld :: %d :: %ld
\n
"
,
event
->
data
.
download_update
.
id
,
event
->
data
.
download_update
.
got
,
event
->
data
.
download_update
.
total
,
event
->
data
.
download_update
.
percent
,
event
->
data
.
download_update
.
speed
);
lua_rawgeti
(
he_L
,
LUA_REGISTRYINDEX
,
event
->
handlers
);
lua_pushstring
(
he_L
,
"on_download_update"
);
lua_gettable
(
he_L
,
-
2
);
...
...
@@ -326,12 +328,13 @@ static void handle_event(WebEvent *event) {
break
;
case
TE4_WEB_EVENT_DOWNLOAD_FINISH
:
printf
(
"[WEBCORE] download finish %ld
\n
"
,
event
->
data
.
download_finish
.
id
);
lua_rawgeti
(
he_L
,
LUA_REGISTRYINDEX
,
event
->
handlers
);
lua_pushstring
(
he_L
,
"on_download_finish"
);
lua_gettable
(
he_L
,
-
2
);
lua_remove
(
he_L
,
-
2
);
if
(
!
lua_isnil
(
he_L
,
-
1
))
{
lua_pushnumber
(
he_L
,
event
->
data
.
download_
update
.
id
);
lua_pushnumber
(
he_L
,
event
->
data
.
download_
finish
.
id
);
docall
(
he_L
,
1
,
0
);
}
else
lua_pop
(
he_L
,
1
);
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment