Re: [code] MMB click on tab bar (FR)

From: Procházka Lukáš Ing. <LPr.att.pontex.cz>
Date: Fri, 13 Sep 2019 15:55:36 +0200

Hello Mitchell,

great news -

On Thu, 12 Sep 2019 22:58:46 +0200, Mitchell <m.att.foicica.com> wrote:

> Hi Lukas,
>
> On Wed, 11 Sep 2019, Procházka Lukáš Ing. wrote:
>
>> Hello Mitchell,
>>
>> many editors allow to close the active document clicking by the middle mouse
>> button (MMB) on the document tab.
>>
>> Would it be possible to generate an event when user clicks by MMB on the tab
>> bar, witch an additional info about buffer being clicked?
>>
>> (This is just a feature request, not necessary needs to be implemented.)
>
> Yes, it would be possible to generate such an event. Right now, *src/textadept.c*'s `t_tabbuttonpress()` function discards any button clicks except for right-click. You'd want to allow for middle-clicks and then emit a new event into Textadept's Lua state, something like:
>
> lL_event(lua, "tab_middle_clicked", LUA_TNUMBER, page_num + 1, -1);
>
> where `page_num` is the page you determine was clicked (code that can help is in `t_tabbuttonpress()`).

- could it be implemented into the upcoming TA version?

- Also an additional info about keys being pressed herewith (Ctrl/Shift/Alt) would be nice, maybe this:

----
lL_event(lua, "tab_middle_clicked", LUA_TNUMBER, page_num + 1,
                                     event_mod(SHIFT), event_mod(CONTROL), event_mod(MOD1), event_mod(META), event_mod(LOCK),
                                     -1);
----
(I'm using just the TA executables (with Lua add-ins) - and I'd rather not try to built the .exe from sources - I'm familiar with Visual Studio but not with MinGW nor other C-building tools.)
Cheers,
Lukas
> Cheers,
> Mitchell
-- 
Ing. Lukáš Procházka | mailto:LPr.att.pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4
Mob.: +420 702 033 396
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Fri 13 Sep 2019 - 09:55:36 EDT

This archive was generated by hypermail 2.2.0 : Sat 14 Sep 2019 - 06:26:23 EDT