Re: [code] [textadept] MENU_KEY support

From: Robert Gieseke <rob.g.att.web.de>
Date: Sun, 23 Feb 2014 10:21:30 +0100

Hi Martin,

Am 21/02/14 18:05, schrieb Mitchell:
[snip]
>> However another annoyance popped up: I am heavy menu_key user.
>> That is the key usually between right Super(Win) and right Ctrl keys.
>> It is meant to be used for invoking context menu.
>>
>> With bit of playing around with xev and textadept core I got
>> it to register with editor, however I am clueless on how to
>> popup context menu programatically. There seem to be no such function in
>> api.
>>
>> Also on linux, I found most GUI editors suck at providing proper
>> support for this often underused key (ctx.menu invoked from
>> keyboard pops at most unexpected location and not at cursor position).
>>
>> I would love to get this working under textadept at least, with popup
>> menu appearing relative to caret.
>>
>> Any hints please?
>
> Unfortunately this is not possible at the moment. It used to be the case
> that GTK bound Shift+F10 to popup the context menu, but that no longer
> seems to be the case. At any rate, the popup would display at the
> position of the mouse cursor, not the caret. In order to popup at the
> caret, you'd have to have C code that retrieves the (x, y) GUI
> coordinates of the caret (via Scintilla API), creates a fake event to
> popup the context menu at said (x, y) coordinates, and then call
> Textadept's `lL_contextmenu()`. And then of course to expose this to
> Textadept via Lua, you'd have to register a Lua function, etc. etc. If
> you're feeling adventurous, feel free to submit a patch, but I don't
> think this is trivial :(
>

maybe you could bind this to a filtered list [1] or a buffer user list
[2] as an alternative to the context menu?

Cheers,
Robert

[1]
http://foicica.com/textadept/api/ui.dialogs.html#L.code.filteredlist..code...em.options..em..
[2]
http://foicica.com/textadept/api/buffer.html#L.code.user_list_show..code...em.buffer..id..items..em..

-- 
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 Sun 23 Feb 2014 - 04:21:30 EST

This archive was generated by hypermail 2.2.0 : Sun 23 Feb 2014 - 06:39:47 EST