Giter Club home page Giter Club logo

Comments (3)

banthar avatar banthar commented on August 17, 2024

Are you running it on amd64 ?
If so, you probably need to regenerate sdl_defs.go (touch sdl.c ; make).
But after that (probably due to bug in godefs) you need to repair Keysym struct.
You need to change the type of Sym from byte to uint32 and remove unnecessary padding.
Im not sure if that is correct on amd64, so you need to experiment, or send me the whole file and i will try to figure it out.

If that doesn't help get the most recent version, i added some more debugging.

from go-sdl.

Daminvar avatar Daminvar commented on August 17, 2024

Yeah, I'm using a 64 bit processor. I regenerated the sdl_defs.go file, although I got a bunch of warnings doing so.

godefs -g sdl sdl.c > sdl_defs.go
warning: missing name for struct sprivate_hwdata
warning: missing name for struct sSDL_BlitMap
ignoring bitfield $VideoInfo.hw_available
ignoring bitfield $VideoInfo.wm_available
ignoring bitfield $VideoInfo.UnusedBits1
ignoring bitfield $VideoInfo.UnusedBits2
ignoring bitfield $VideoInfo.blit_hw
ignoring bitfield $VideoInfo.blit_hw_CC
ignoring bitfield $VideoInfo.blit_hw_A
ignoring bitfield $VideoInfo.blit_sw
ignoring bitfield $VideoInfo.blit_sw_CC
ignoring bitfield $VideoInfo.blit_sw_A
ignoring bitfield $VideoInfo.blit_fill
warning: missing name for struct sprivate_yuvhwfuncs
warning: missing name for struct sprivate_yuvhwdata
ignoring bitfield $Overlay.hw_overlay
ignoring bitfield $Overlay.UnusedBits
6g -o _go_.6 sdl_defs.go sdl.cgo1.go sdl.cgo2.go
rm -f _obj/sdl.a
gopack grc _obj/sdl.a _go_.6 sdl.cgo3.6

The generated file is here (http://gopaste.org/view/3nN2O ) I changed Sym from byte to uint32 and I removed the paddings (I also tried different combinations of removing or keeping the padding in the Keysym struct) but I still got the unknown key error printed. However, if I press control and hit any key in the test, then the first number becomes 64 and an @ symbol is printed. When the shift key is pressed, the first number becomes one, but unknown key is still printed.

from go-sdl.

banthar avatar banthar commented on August 17, 2024

Cgo adds extra algnment before nested structs. I corrected Keysym by hand and everything except Scancode should work now (for amd64). I will try to find better solution.

from go-sdl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.