Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown key value throws error #35

Open
MarcMush opened this issue Apr 9, 2021 · 1 comment
Open

Unknown key value throws error #35

MarcMush opened this issue Apr 9, 2021 · 1 comment

Comments

@MarcMush
Copy link

MarcMush commented Apr 9, 2021

Games crash when pressing a key that is not in Keys.Key, for example non-english characters (here ù) or special keys (like volume up)

julia> rungame("GZExamples\\Spaceship\\Spaceship.jl")
┌ Warning: Use lowercases names for resource files. It is safer when moving between windows and unix: Space_pod.png
└ @ GameZero C:\Users\user\.julia\packages\GameZero\QdBGK\src\resources.jl:103
┌ Error: ArgumentError("invalid value for Enum Key: 249")
│   exception =
│    ArgumentError: invalid value for Enum Key: 249
│    Stacktrace:
│      [1] enum_argument_error(typename::Symbol, x::UInt32)
│        @ Base.Enums .\Enums.jl:79
│      [2] Key
│        @ .\Enums.jl:192 [inlined]
│      [3] handleKeyPress(g::Game, e::Vector{UInt8}, t::UInt32)
│        @ GameZero ~\.julia\packages\GameZero\QdBGK\src\GameZero.jl:143
│      [4] handleEvents!
│        @ ~\.julia\packages\GameZero\QdBGK\src\GameZero.jl:126 [inlined]
│      [5] mainloop(g::Game)
│        @ GameZero ~\.julia\packages\GameZero\QdBGK\src\GameZero.jl:95
│      [6] rungame(jlf::String)
│        @ GameZero ~\.julia\packages\GameZero\QdBGK\src\GameZero.jl:186
│      [7] top-level scope
│        @ REPL[25]:1
│      [8] eval(m::Module, e::Any)
│        @ Core .\boot.jl:360
│      [9] eval_user_input(ast::Any, backend::REPL.REPLBackend)
│        @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:139
│     [10] repl_backend_loop(backend::REPL.REPLBackend)
│        @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:200
│     [11] start_repl_backend(backend::REPL.REPLBackend, consumer::Any)
│        @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:185
│     [12] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool)
│        @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:317
│     [13] run_repl(repl::REPL.AbstractREPL, consumer::Any)
│        @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:305
│     [14] (::Base.var"#878#880"{Bool, Bool, Bool})(REPL::Module)
│        @ Base .\client.jl:387
│     [15] #invokelatest#2
│        @ .\essentials.jl:707 [inlined]
│     [16] invokelatest
│        @ .\essentials.jl:706 [inlined]
│     [17] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
│        @ Base .\client.jl:372
│     [18] exec_options(opts::Base.JLOptions)
│        @ Base .\client.jl:302
│     [19] _start()
│        @ Base .\client.jl:485
└ @ GameZero C:\Users\user\.julia\packages\GameZero\QdBGK\src\GameZero.jl:189
@aviks
Copy link
Owner

aviks commented Apr 9, 2021

Yes, indeed, it does. I tried to be too clever in building the keyboard handling code, needs fixing. I'll see what I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants