calref / cboe

Classic Blades of Exile
http://spiderwebforums.ipbhost.com/index.php?/forum/12-blades-of-exile/
Other
173 stars 42 forks source link

Clicking with modifier keys doesn't seem to work #291

Closed CelticMinstrel closed 1 year ago

CelticMinstrel commented 1 year ago

I noticed it at the startup screen – alt-clicking Start Scenario with no party should automatically create a default party, but it doesn't work currently. Might be other things affected too, like Alt+Click for Look.

I also have a feeling that this might be just my computer, or possibly something to do with the version of SFML or something.

fosnola commented 1 year ago

On OsX, you need to add Blades Exile, ... to the applications which can monitor the input see https://support.apple.com/en-ca/guide/mac-help/mchl4cedafb6/mac .

CelticMinstrel commented 1 year ago

I don't think that's correct. I did notice that it was requesting that permission, but surely it shouldn't need that permission just to check if a modifier is pressed? That permission is about monitoring input when another app is active. It only needs to monitor input when the game is active.

fosnola commented 1 year ago

This may be linked to https://en.sfml-dev.org/forums/index.php?topic=26849.0 . After yes, I also think it's a pity to have to add rights with the system preferences (especially since you have to do it again each time you recreate an executable :-~)

CelticMinstrel commented 1 year ago

Based on that post, it sounds like any use of IsKeyPressed is broken, which sounds seriously incredible. It says you should exclusively use events to determine the key press, but there is no way to do that for modified mouse clicks (that I know of).

fosnola commented 1 year ago

Normally, in swift/cocoa, a mouse event https://developer.apple.com/documentation/appkit/nsevent/1532495-mouseevent seems to contain some modifierFlag. In SFML, I'm not sure if we can retrieve them :-~

I guess IsKeyPressed calls a low-level routine to retrieve the keyboard state, so it is protected.