emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Input for TTY menus


From: Darren Hoo
Subject: Re: Input for TTY menus
Date: Fri, 18 Oct 2013 15:37:06 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (darwin)

Eli Zaretskii <address@hidden> writes:

>> Also with GPM, click on the top menu  it gives:
>>       <nil> <mouse-1> is undefined
>
> That's strange, maybe there's some bug in keyboard.c.  Could you
> please step with a debugger into the code in keyboard.c that starts
> like this:
>
>       /* A mouse click.  Figure out where it is, decide whether it's
>          a press, click or drag, and build the appropriate structure.  */
>       case MOUSE_CLICK_EVENT:
>   #ifndef USE_TOOLKIT_SCROLL_BARS
>       case SCROLL_BAR_CLICK_EVENT:
>   #endif
>       {
>         int button = event->code;
>         bool is_double;
>         Lisp_Object position;
>         Lisp_Object *start_pos_ptr;
>         Lisp_Object start_pos;
>
>         position = Qnil;
>
>         /* Build the position as appropriate for this mouse click.  */
>         if (event->kind == MOUSE_CLICK_EVENT)
>           {
>             struct frame *f = XFRAME (event->frame_or_window);
>             int row, column;
>
> and see what is going on there when GPM mouse is clicked on the menu
> bar?  The expected result is that Emacs loops through menu items below
> this code, finds the menu-bar menu item where you clicked, and return
> a menu-bar click event like this:
>
>                   position = list4 (event->frame_or_window,
>                                     Qmenu_bar,
>                                     Fcons (event->x, event->y),
>                                     make_number (event->timestamp));
>
>                   return list2 (item, position);

I am not quite handy on this code, but I'll give it a try, is what follows
helpul?

Breakpoint 1, make_lispy_event (address@hidden) at keyboard.c:5425
5425    {
(gdb) 
(gdb) list
5420       are received; this function stores the location of button presses
5421       in order to build drag events when the button is released.  */
5422    
5423    static Lisp_Object
5424    make_lispy_event (struct input_event *event)
5425    {
5426      int i;
5427    
5428      switch (event->kind)
5429        {
(gdb) p event->kind
$3 = GPM_CLICK_EVENT
(gdb) n
5428      switch (event->kind)
(gdb) 
5425    {
(gdb) 
5428      switch (event->kind)
(gdb) 
6037            if (button >= ASIZE (button_down_location))
(gdb) 
6031            struct frame *f = XFRAME (event->frame_or_window);
(gdb) 
6035            int button = event->code;
(gdb) 
6037            if (button >= ASIZE (button_down_location))
(gdb) 
6031            struct frame *f = XFRAME (event->frame_or_window);
(gdb) 
6037            if (button >= ASIZE (button_down_location))
(gdb) 
6046            start_pos = *start_pos_ptr;
(gdb) 
6048            position = make_lispy_position (f, event->x, event->y,
(gdb) 
6046            start_pos = *start_pos_ptr;
(gdb) 
6048            position = make_lispy_position (f, event->x, event->y,
(gdb) 
6051            if (event->modifiers & down_modifier)
(gdb) 
6048            position = make_lispy_position (f, event->x, event->y,
(gdb) 
6051            if (event->modifiers & down_modifier)
(gdb) 
6052              *start_pos_ptr = Fcopy_alist (position);
(gdb) 
6060            head = modify_event_symbol (button,
(gdb) 
6067            if (event->modifiers & drag_modifier)
(gdb) 
6069            else if (event->modifiers & double_modifier)
(gdb) 
6071            else if (event->modifiers & triple_modifier)
(gdb) 
6074              return list2 (head, position);
(gdb) p head
$4 = 140490514
(gdb) p position
$5 = 142829718
(gdb) n




reply via email to

[Prev in Thread] Current Thread [Next in Thread]