does somebody know how can i register/handle a right mouse click on a button in imgui?
EDIT: i have found the solution:
if imgui:isItemHovered(ImGui.HoveredFlags_AllowWhenBlockedByActiveItem)and imgui:isMouseClicked(KeyCode.MOUSE_RIGHT)then .... end
the trick was that instead of "ImGui.MouseButton_Right" one needs to put "KeyCode.MOUSE_RIGHT" into imgui:isMouseClicked() for some reason.
actually with this trick there is a simpler solution:
if imgui:isItemClicked(KeyCode.MOUSE_RIGHT)then .... end
EDIT: both solutions are not perfect as they register many presses, not just one, if one does not release the button very quickly. also it registers even if i pressed right button before hovering the item. i will post solution when i have one.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
about my problem with right-clicking i also asked on the main imgui forum and it seems there is no clean solution: https://github.com/ocornut/imgui/issues/4241#issuecomment-864372615 which makes me want to try to avoid this advanced behavior of buttons in the future, as it was unintuitive for many users anyway (even though i liked it a lot).
@rrraptor I think proxy->unref() is not needed here, it will be destroyed by lua when the object goes out of scope. BTW we (@SinisterSoft and I) found the reason from the crash in html (and actually all platforms beside Qt): it was due to autoCursorUpdate not being initialized and being enabled while only Qt platform supports setting of the cursor.
i have found a small issue: even though i set IO = imgui:getIO() IO:setConfigWindowsMoveFromTitleBarOnly() i can still move the window by grabbing it anywhere (Which is not a button etc)
another small thing: in an imgui:inputText object when i press backspace it usually deletes suddenly a lot of characters, instead of one at a time. can i change this behaviour?
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
another small thing: in an imgui:inputText object when i press backspace it usually deletes suddenly a lot of characters, instead of one at a time. can i change this behaviour?
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
i've noticed that also delete button and left/right arrows register 4-5 times when only pressed once in an inputtext. in an early version when the menu was just in itself (doing nothing) and not merged with my app, it worked fine. but i don't know what changed that lead to this behaviour.
@rrraptor I think proxy->unref() is not needed here, it will be destroyed by lua when the object goes out of scope. BTW we (@SinisterSoft and I) found the reason from the crash in html (and actually all platforms beside Qt): it was due to autoCursorUpdate not being initialized and being enabled while only Qt platform supports setting of the cursor.
i have found a small issue: even though i set IO = imgui:getIO() IO:setConfigWindowsMoveFromTitleBarOnly() i can still move the window by grabbing it anywhere (Which is not a button etc)
No problems for me...
--must be
IO:setConfigWindowsMoveFromTitleBarOnly(true)
another small thing: in an imgui:inputText object when i press backspace it usually deletes suddenly a lot of characters, instead of one at a time. can i change this behaviour?
i've noticed that also delete button and left/right arrows register 4-5 times when only pressed once in an inputtext. in an early version when the menu was just in itself (doing nothing) and not merged with my app, it worked fine. but i don't know what changed that lead to this behaviour.
No problems for me. You can try to tweak this settings:
about the "IO:setConfigWindowsMoveFromTitleBarOnly(true)" issue i did it call with true, of course. i've found the thing that i did wrong. the problem was that there was no titlebar at all on my window (and then this flag is discarded), i've confused the menubar with the titlebar.
so overall there is a situation i can't solve: i don't want a title bar just only contains a name, instead i want a menu bar at the top of the window and grabbing that should be the only way to move the window. the neatest solution would be to be able to add menus to the title bar. is that possible? (i think a year ago we've discussed this problem but i don't remember if there was a possibility)
for the key issue i set IO:setKeyRepeatDelay(1000) -- default 0.25 IO:setKeyRepeatRate(1000) -- default 0.05 and it does not have any affect (not only i still have the backspace etc. issue, pressing any character the repeat delay and rate seem to be the same as without these values set to 1000.
about the "IO:setConfigWindowsMoveFromTitleBarOnly(true)" issue i did it call with true, of course. i've found the thing that i did wrong. the problem was that there was no titlebar at all on my window (and then this flag is discarded), i've confused the menubar with the titlebar.
so overall there is a situation i can't solve: i don't want a title bar just only contains a name, instead i want a menu bar at the top of the window and grabbing that should be the only way to move the window. the neatest solution would be to be able to add menus to the title bar. is that possible? (i think a year ago we've discussed this problem but i don't remember if there was a possibility)
so let me know how to do it, although i guess you've modified the source code to achieve that and so i need to wait for the next version. it's fun that on the main imgui github page i'm still trying to explain what i want and try to be taken seriously while you've already done it. that's what i call gideros forum-style help. thanks
Is there a way in imgui for an event to be generated when a key is pressed in a text input box. That way the Enter key can be checked for so an action occurs if they write some text and press Enter.
Also is there a way to set a specific gadget to be the active one - eg after they enter a username, you set the active gadget to be the password input box.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Comments
EDIT: i have found the solution:
actually with this trick there is a simpler solution:
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
DELETEDuseless commenthttps://github.com/jvcleave/ofxImGui/issues/55
https://discourse.dearimgui.org/t/distinguish-between-drag-click-double-click-after-mouse-release/283/3
hope this helps/works?
EDIT:
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
In my main.lua ....
Basically I only create each ui once, I then hide and unhide it as required = goodbye texture memory leak...
Don't forget to set the name for each scene ui, I name them after the scene name.
Likes: MoKaLux
https://deluxepixel.com
This is the fix, but I feel like there should be
https://github.com/gideros/gideros/pull/510
Likes: MoKaLux
about my problem with right-clicking i also asked on the main imgui forum and it seems there is no clean solution:
https://github.com/ocornut/imgui/issues/4241#issuecomment-864372615
which makes me want to try to avoid this advanced behavior of buttons in the future, as it was unintuitive for many users anyway (even though i liked it a lot).
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
BTW we (@SinisterSoft and I) found the reason from the crash in html (and actually all platforms beside Qt): it was due to autoCursorUpdate not being initialized and being enabled while only Qt platform supports setting of the cursor.
Likes: keszegh, MoKaLux, SinisterSoft
even though i set
IO = imgui:getIO()
IO:setConfigWindowsMoveFromTitleBarOnly()
i can still move the window by grabbing it anywhere (Which is not a button etc)
Fragmenter - animated loop machine and IKONOMIKON - the memory game
FontAtlas:bake()
does not seem to exist.
(after calling FontAtlas = IO:getFonts())
EDIT: FontAtlas:build() seems to do the job so probably https://github.com/MultiPain/Gideros_ImGui#minimal-example needs to be corrected.
let me know if you prefer issues to be added on github.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
in an imgui:inputText object when i press backspace it usually deletes suddenly a lot of characters, instead of one at a time. can i change this behaviour?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://deluxepixel.com
Likes: SinisterSoft
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: MoKaLux
https://deluxepixel.com
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
You can edit readme if you want Fixed. No problems for me.
You can try to tweak this settings:
Likes: keszegh
Likes: SinisterSoft
From LUA simply call
so overall there is a situation i can't solve:
i don't want a title bar just only contains a name, instead i want a menu bar at the top of the window and grabbing that should be the only way to move the window. the neatest solution would be to be able to add menus to the title bar. is that possible? (i think a year ago we've discussed this problem but i don't remember if there was a possibility)
Fragmenter - animated loop machine and IKONOMIKON - the memory game
IO:setKeyRepeatDelay(1000) -- default 0.25
IO:setKeyRepeatRate(1000) -- default 0.05
and it does not have any affect (not only i still have the backspace etc. issue, pressing any character the repeat delay and rate seem to be the same as without these values set to 1000.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://github.com/ocornut/imgui/issues/4258
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: MoKaLux
Can you post a screenshot?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
it's fun that on the main imgui github page i'm still trying to explain what i want and try to be taken seriously while you've already done it. that's what i call gideros forum-style help. thanks
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Also is there a way to set a specific gadget to be the active one - eg after they enter a username, you set the active gadget to be the password input box.
https://deluxepixel.com