In other news:
I finally found a way around the “GRLESS” issue on Linux - where Blender does not recognize this (and a few other keys) for shortcuts & modal input.
(The issue has been reported since many years. It’s on “Low” priority.)
This is why this is a thing - its a lot closer to X & Z, for quick Axis picking and such. (I use a Swedish keyboard, so it’s GRLESS for me)
(A very handy key for shortcuts in general, besides Y-replacement - if only it would work in Blender on Linux:
Anyways, here’s the “solution” (at the top o a modal)
def modal(self, context, event):
if not event.type:
self.grless_hack = True
and then check for it:
if self.grless_hack or event.type in {'Y', 'GRLESS'} and event.value == 'PRESS':
# Do stuff
self.grless_hack = False
Disclaimers:
- This will only work in modals, not shortcuts, obviously.
- It will (probably) catch ANY “unrecognized key” as “<” in this context: If you have a keyboard with a different unrecognized key you can use, this might still work for “Y” replacement.
- I’m still including “GRLESS” for the platforms that work properly already, + future-proofing.
- If it works well, I will add it to ALL my scripts with “axis picking” with a modal. Eventually.
Seems to work fine so far at least ;> (edit: only downside is some “unrecognized key code” warnings in the console. nothing I can do about that though.)