onKeyDown and onKeyUp event firing

With SketchUp’s latest releases a problem was introduced that appears to affect only the PC version of SketchUp. The event onKeyDown is supposed to fire once each time a user presses a keyboard key. In the following releases it fires twice:

PC – 23.1.340 64-bit
Mac – 23.1.341 64-bit – Appears to not be an issue with the Mac implementation.

I attempted a work-around by using onKeyUp. But then the Alt key only fires with every other use of the Alt key. The Mac seems to work fine. I have spent a lot of time searching the web and found no mention of this problem. Has anyone else noticed it?

Joe…

If you do not find an issue logged in the official API issue tracker, please open one for this specific problem.

As I recall, at one time in the past, there were old issues on the Mac with the onKeyDown callback.

I can’t reproduce the problem with this snippet on W11 (SU 23.1.340):

class MyTool
  def onKeyDown(key, repeat, flags, view)
    puts "onKeyDown: key = #{key}"
    puts "        repeat = #{repeat}"
    puts "         flags = #{flags}"
    puts "          view = #{view}"
  end
  def onKeyUp(key, repeat, flags, view)
    puts "onKeyUp: key = #{key}"
    puts "      repeat = #{repeat}"
    puts "       flags = #{flags}"
    puts "        view = #{view}"
  end
end

my_tool = MyTool.new
Sketchup.active_model.select_tool(my_tool)

Perhaps this is more about how Windows uses the ALT key for activating the menu bar ?