Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyboard control of buttons is broken: erratic behavior #12

Open
emp-00 opened this issue Dec 15, 2024 · 0 comments
Open

keyboard control of buttons is broken: erratic behavior #12

emp-00 opened this issue Dec 15, 2024 · 0 comments

Comments

@emp-00
Copy link

emp-00 commented Dec 15, 2024

@nperovic: I think I found a bug - keyboard control of multiple buttons does not work correctly anymore with ColorButton.ahk.

See my small demo-script with 5 buttons below, it finishes by giving the 2nd button keyboard focus but the same effect occurs with other buttons in initial focus:

  • If you comment out the SetColor-lines (thus using standard uncolored AHK buttons) you can use the keyboard Left, Right, Up, Down and Tab to correctly move around and select any desired button.
  • However, when SetColor is active the next button which is selected when using the keyboard is very erratic
  • Focus mostly does NOT jump to the next button in the row, and some buttons cannot be reached at all!
  • For testing please use the keyboard multiple times left/right/up/down/tab, you will see what I mean

This must be connected to the ColorButton library... Does anybody have an idea how to fix this?
I'm using Win11, AHK v2 2.0.18 64bit and ColorButton from github version 1.3.1 dated 2024/06/08

`#Requires AutoHotkey v2
#Include ; ColorButton by pperovic, see https://www.autohotkey.com/boards/viewtopic.php?t=129511

myGui := Gui()
myGui.SetFont("s14", "Segoe UI")
btn1 := myGui.AddButton("x5 w50 h30", "Save")
btn1.SetColor("d7fad2", , 5, "909090")
btn2 := myGui.AddButton("x+10 w50 h30", "Copy")
btn2.SetColor("cce9f0", , 5, "909090")
btn3 := myGui.AddButton("x+10 w50 h30", "Exit")
btn3.SetColor("ffb26e", , 5, "909090")
btn4 := myGui.AddButton("x+10 w100 h30", "Cancel")
btn4.SetColor("ffb26e", , 5, "909090")
btn5 := myGui.AddButton("x+10 w50 h30", "Test")
btn5.SetColor("f6f8fa", , 5, "909090")

btn2.Focus()
myGui.Show("Autosize")`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant