Skip to content

Instantly share code, notes, and snippets.

@kungfooman
Created June 19, 2017 04:12
Show Gist options
  • Save kungfooman/9099be87226a7ef7706e2f6470b7f468 to your computer and use it in GitHub Desktop.
Save kungfooman/9099be87226a7ef7706e2f6470b7f468 to your computer and use it in GitHub Desktop.
type keyboard_s
forward::Int32
backward::Int32
left::Int32
right::Int32
jump::Int32
end
address = ccall(:malloc, (Int64), (Int64, ), sizeof(keyboard_s))
ptr = Ptr{keyboard_s}(address)
thekeyboard = unsafe_load(ptr)
thekeyboard.forward = 1 # this has no effect on the real memory address :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment