The "mouse_callbacks={"Button1": lambda q: q.cmd_simulate_keypress([], 
"F12")}" works like a charm! Thank you so much elParaguayo!

On Thursday, December 3, 2020 at 2:55:43 a.m. UTC-5 elParaguayo wrote:

> Yes, you can do that.
>
> Not sure this is the "official" way, but you could do something like this:
> mouse_callbacks={"Button1": lambda q: q.cmd_simulate_keypress([], "F12")}
>
> On Thursday, 3 December 2020 at 05:49:52 UTC [email protected] wrote:
>
>> Thank you for your effort elParaguayo!
>> Maybe, I have a better idea! Is it possible to implement a textbox widget 
>> which send a keystoke when it receives a mouse clic.
>> For  the drop down terminal, i have "F12" key bound to toggle it, so if 
>> i can send "F12" keystoke each time i press on the text box widget, it 
>> would fix the problem!!! 
>>
>> Best Regards 
>> Kais 
>>
>> ------------------------------
>> *From:* [email protected] <[email protected]> on behalf of 
>> elParaguayo <[email protected]>
>> *Sent:* Thursday, December 3, 2020 12:20:13 AM
>> *To:* qtile-dev <[email protected]>
>> *Subject:* [qtile-dev] Re: Mousecallbacks to toggle the Scratchpad 
>>  
>> Interesting. I would have expected an error from that one as callbacks 
>> are executed by calling the function that's passed. Assuming you're on 
>> 0.16.1, clicking the mouse would try to make the script run the following: 
>> lazy.group['scratchpad'].dropdown_toggle("xterm")(qtile)
>>
>> This shouldn't work as lazy objects aren't callable.
>>
>> I tried changing the callback to: lambda qtile: 
>> lazy.group['scratchpad'].dropdown_toggle('xterm') but that also didn't work.
>>
>> I then tried creating a function in my config file:
>> def scratch_callback(qtile):
>>      lazy.group['scratchpad'].dropdown_toggle("term")
>>
>> and set the callback to "scratch_callback". That didn't work.
>>
>> Lastly, I changed the callback function to:
>> def scratch_callback(qtile):
>>      qtile.groups_map["scratchpad"].dropdowns["term"].toggle()
>>
>> And that *did* work but only after I'd opened the scratchpad by the key 
>> press once first.
>>
>> All very confusing.
>> On Thursday, 3 December 2020 at 01:28:02 UTC [email protected] wrote:
>>
>>
>> Hello guys
>> I tried to implement a textbox widget to toggle the terminal dropdown, 
>> when left-clik on it. I added this code to the textbox widget:
>>
>> mouse_callbacks = { 
>> 'Button1': lazy.group['scratchpad'].dropdown_toggle("term")} 
>> I did not get any error, but when I click on the textbox, nothing happens!
>> Can someone help me to fix this please?
>>
>> Thanks in advance
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "qtile-dev" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/qtile-dev/AyITKbeySF4/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/qtile-dev/18b074cc-f2bf-4e5d-baab-e42c439e3772n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/qtile-dev/18b074cc-f2bf-4e5d-baab-e42c439e3772n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qtile-dev/4772761f-52ac-4037-998c-8bf2f579b2e4n%40googlegroups.com.

Reply via email to