BGUI issue: 'module' object has no attribute 'OSKEY'

I need to have a robust GUI system for my game, and I think BGUI is just what I need.

But, when I try to use it with the example script given, I get this traceback error:

 line 38, in <dictcomp>
    self.keymap = {getattr(, val): getattr(bgui, val) for val in dir( if val.endswith('KEY') or val.startswith('PAD')}
AttributeError: 'module' object has no attribute 'OSKEY'

I’ve been hunting around for a long time trying to find a solution to this particular problem, and digging through all the BGUI .py files trying to find where this line of code is.
After searching for ‘self.keymap’ in every py file in the BGUI folder, I get zero hits.

What is wrong, and how can I fix it?

It seems like you’re using an old version of BGUI

Yes. What if you delete last line of (sorry in your version maybe you had not this script) (OSKEY = 172)… Or change the value of OSKEY if its value != 172?

(You can download the last (I think) BGUI here: (download ZIP))

Yes, the newest version works just fine.
Thank you, that was quick!

What is OSKEY? It’s not mentionned here:, no?

It’s the windows key on Windows keyboards, not sure about other systems or layouts

Thank you!