New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numeric keypad "Enter" key stopped working #327

Closed
wodim opened this Issue Oct 5, 2015 · 9 comments

Comments

Projects
None yet
4 participants
@wodim

wodim commented Oct 5, 2015

Well, the issue title summarises it well: you can't send messages using the Enter key that there is in the numeric keypad since some time ago.

@vague666

This comment has been minimized.

Show comment
Hide comment
@vague666

vague666 Oct 5, 2015

Member

Can you paste your /bind and /sv output?

Member

vague666 commented Oct 5, 2015

Can you paste your /bind and /sv output?

@wodim

This comment has been minimized.

Show comment
Hide comment
@wodim

wodim Oct 5, 2015

I have never messed with my binds, I think, but well...

Irssi 0.8.18-g696bc43 (20150927) - http://irssi.org/
12:06:36 Key                  Action
12:06:36 ^H                   key backspace
12:06:36 ^I                   key tab
12:06:36 ^J                   key return
12:06:36 meta2-2~             key insert
12:06:36 meta2-1;3A           key mup
12:06:36 ^M                   key return
12:06:36 meta2-6~             key next
12:06:36 meta2-1;3D           key mleft
12:06:36 meta2-1;3B           key mdown
12:06:36 meta2-1;3C           key mright
12:06:36 meta2-1;5~           key chome
12:06:36 meta2-A              key up
12:06:36 ^[                   key meta
12:06:36 meta2-B              key down
12:06:36 meta2-C              key right
12:06:36 meta2-D              key left
12:06:36 meta2-F              key end
12:06:36 meta2-G              key next
12:06:36 meta2-H              key home
12:06:36 meta2-I              key prior
12:06:36 meta2-3~             key delete
12:06:36 ^?                   key backspace
12:06:36 meta2-7~             key home
12:06:36 meta-left            key mleft
12:06:36 meta2-5C             key cright
12:06:36 meta-[O              key meta2
12:06:36 meta2-5F             key cend
12:06:36 meta2-5D             key cleft
12:06:36 meta2-5H             key chome
12:06:36 meta-up              key mup
12:06:36 meta2-c              key cright
12:06:36 meta2-d              key cleft
12:06:36                      key space
12:06:36 meta-right           key mright
12:06:36 meta2-4~             key end
12:06:36 meta2-8~             key end
12:06:36 meta2-1;5C           key cright
12:06:36 meta2-1;5D           key cleft
12:06:36 meta2-1;5F           key cend
12:06:36 meta2-1;5H           key chome
12:06:36 meta-down            key mdown
12:06:36 meta2-1~             key home
12:06:36 meta-O               key meta2
12:06:36 meta2-5~             key prior
12:06:36 meta2-8;5~           key cend
12:06:36 meta2-7;5~           key chome
12:06:36 meta-[               key meta2
12:06:36 meta2-4;5~           key cend
12:06:36 space                multi check_replaces;insert_text
12:06:36 return               multi check_replaces;send_line
12:06:36 left                 backward_character
12:06:36 right                forward_character
12:06:36 meta-b               backward_word
12:06:36 cleft                backward_word
12:06:36 cright               forward_word
12:06:36 meta-f               forward_word
12:06:36 home                 beginning_of_line
12:06:36 ^A                   beginning_of_line
12:06:36 end                  end_of_line
12:06:36 ^E                   end_of_line
12:06:36 up                   backward_history
12:06:36 down                 forward_history
12:06:36 backspace            backspace
12:06:36 delete               delete_character
12:06:36 ^D                   delete_character
12:06:36 meta-d               delete_next_word
12:06:36 meta-backspace       delete_previous_word
12:06:36 ^W                   delete_to_previous_space
12:06:36 ^U                   erase_line
12:06:36 ^K                   erase_to_end_of_line
12:06:36 ^Y                   yank_from_cutbuffer
12:06:36 ^T                   transpose_characters
12:06:36 tab                  word_completion
12:06:36 meta-k               erase_completion
12:06:36 ^P                   previous_window
12:06:36 ^N                   next_window
12:06:36 mup                  upper_window
12:06:36 mdown                lower_window
12:06:36 mleft                left_window
12:06:36 mright               right_window
12:06:36 meta-a               active_window
12:06:36 ^X                   next_window_item
12:06:36 ^L                   refresh_screen
12:06:36 meta-p               scroll_backward
12:06:36 prior                scroll_backward
12:06:36 meta-n               scroll_forward
12:06:36 next                 scroll_forward
12:06:36 chome                scroll_start
12:06:36 cend                 scroll_end
12:06:36 meta-e               change_window 13
12:06:36 meta-r               change_window 14
12:06:36 meta-t               change_window 15
12:06:36 meta-w               change_window 12
12:06:36 meta-o               change_window 19
12:06:36 meta-q               change_window 11
12:06:36 meta-u               change_window 17
12:06:36 meta-0               change_window 10
12:06:36 meta-1               change_window 1
12:06:36 meta-2               change_window 2
12:06:36 meta-4               change_window 4
12:06:36 meta-3               change_window 3
12:06:36 meta-5               change_window 5
12:06:36 meta-6               change_window 6
12:06:36 meta-7               change_window 7
12:06:36 meta-8               change_window 8
12:06:36 meta-9               change_window 9
12:06:36 meta-y               change_window 16
12:06:36 meta-i               change_window 18
12:06:36 ^Z                   stop_irc

wodim commented Oct 5, 2015

I have never messed with my binds, I think, but well...

Irssi 0.8.18-g696bc43 (20150927) - http://irssi.org/
12:06:36 Key                  Action
12:06:36 ^H                   key backspace
12:06:36 ^I                   key tab
12:06:36 ^J                   key return
12:06:36 meta2-2~             key insert
12:06:36 meta2-1;3A           key mup
12:06:36 ^M                   key return
12:06:36 meta2-6~             key next
12:06:36 meta2-1;3D           key mleft
12:06:36 meta2-1;3B           key mdown
12:06:36 meta2-1;3C           key mright
12:06:36 meta2-1;5~           key chome
12:06:36 meta2-A              key up
12:06:36 ^[                   key meta
12:06:36 meta2-B              key down
12:06:36 meta2-C              key right
12:06:36 meta2-D              key left
12:06:36 meta2-F              key end
12:06:36 meta2-G              key next
12:06:36 meta2-H              key home
12:06:36 meta2-I              key prior
12:06:36 meta2-3~             key delete
12:06:36 ^?                   key backspace
12:06:36 meta2-7~             key home
12:06:36 meta-left            key mleft
12:06:36 meta2-5C             key cright
12:06:36 meta-[O              key meta2
12:06:36 meta2-5F             key cend
12:06:36 meta2-5D             key cleft
12:06:36 meta2-5H             key chome
12:06:36 meta-up              key mup
12:06:36 meta2-c              key cright
12:06:36 meta2-d              key cleft
12:06:36                      key space
12:06:36 meta-right           key mright
12:06:36 meta2-4~             key end
12:06:36 meta2-8~             key end
12:06:36 meta2-1;5C           key cright
12:06:36 meta2-1;5D           key cleft
12:06:36 meta2-1;5F           key cend
12:06:36 meta2-1;5H           key chome
12:06:36 meta-down            key mdown
12:06:36 meta2-1~             key home
12:06:36 meta-O               key meta2
12:06:36 meta2-5~             key prior
12:06:36 meta2-8;5~           key cend
12:06:36 meta2-7;5~           key chome
12:06:36 meta-[               key meta2
12:06:36 meta2-4;5~           key cend
12:06:36 space                multi check_replaces;insert_text
12:06:36 return               multi check_replaces;send_line
12:06:36 left                 backward_character
12:06:36 right                forward_character
12:06:36 meta-b               backward_word
12:06:36 cleft                backward_word
12:06:36 cright               forward_word
12:06:36 meta-f               forward_word
12:06:36 home                 beginning_of_line
12:06:36 ^A                   beginning_of_line
12:06:36 end                  end_of_line
12:06:36 ^E                   end_of_line
12:06:36 up                   backward_history
12:06:36 down                 forward_history
12:06:36 backspace            backspace
12:06:36 delete               delete_character
12:06:36 ^D                   delete_character
12:06:36 meta-d               delete_next_word
12:06:36 meta-backspace       delete_previous_word
12:06:36 ^W                   delete_to_previous_space
12:06:36 ^U                   erase_line
12:06:36 ^K                   erase_to_end_of_line
12:06:36 ^Y                   yank_from_cutbuffer
12:06:36 ^T                   transpose_characters
12:06:36 tab                  word_completion
12:06:36 meta-k               erase_completion
12:06:36 ^P                   previous_window
12:06:36 ^N                   next_window
12:06:36 mup                  upper_window
12:06:36 mdown                lower_window
12:06:36 mleft                left_window
12:06:36 mright               right_window
12:06:36 meta-a               active_window
12:06:36 ^X                   next_window_item
12:06:36 ^L                   refresh_screen
12:06:36 meta-p               scroll_backward
12:06:36 prior                scroll_backward
12:06:36 meta-n               scroll_forward
12:06:36 next                 scroll_forward
12:06:36 chome                scroll_start
12:06:36 cend                 scroll_end
12:06:36 meta-e               change_window 13
12:06:36 meta-r               change_window 14
12:06:36 meta-t               change_window 15
12:06:36 meta-w               change_window 12
12:06:36 meta-o               change_window 19
12:06:36 meta-q               change_window 11
12:06:36 meta-u               change_window 17
12:06:36 meta-0               change_window 10
12:06:36 meta-1               change_window 1
12:06:36 meta-2               change_window 2
12:06:36 meta-4               change_window 4
12:06:36 meta-3               change_window 3
12:06:36 meta-5               change_window 5
12:06:36 meta-6               change_window 6
12:06:36 meta-7               change_window 7
12:06:36 meta-8               change_window 8
12:06:36 meta-9               change_window 9
12:06:36 meta-y               change_window 16
12:06:36 meta-i               change_window 18
12:06:36 ^Z                   stop_irc
@vague666

This comment has been minimized.

Show comment
Hide comment
@vague666

vague666 Oct 5, 2015

Member

You might be hitting some side effect of this,
efc8f5f

Member

vague666 commented Oct 5, 2015

You might be hitting some side effect of this,
efc8f5f

@wodim

This comment has been minimized.

Show comment
Hide comment
@wodim

wodim Oct 5, 2015

OK, so undo it or maybe tell me how can I bind that key to send a message
as I have always done.

On Mon, Oct 5, 2015 at 12:19 PM, Jari Matilainen notifications@github.com
wrote:

You might be hitting some side effect of this,
efc8f5f
efc8f5f


Reply to this email directly or view it on GitHub
#327 (comment).

wodim commented Oct 5, 2015

OK, so undo it or maybe tell me how can I bind that key to send a message
as I have always done.

On Mon, Oct 5, 2015 at 12:19 PM, Jari Matilainen notifications@github.com
wrote:

You might be hitting some side effect of this,
efc8f5f
efc8f5f


Reply to this email directly or view it on GitHub
#327 (comment).

@vague666

This comment has been minimized.

Show comment
Hide comment
@vague666

vague666 Oct 5, 2015

Member

KeyPress event, serial 29, synthetic NO, window 0x4600001,
root 0xa2, subw 0x0, time 451133822, (-351,718), root:(613,761),
state 0x0, keycode 104 (keysym 0xff8d, KP_Enter), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

KeyPress event, serial 32, synthetic NO, window 0x4600001,
root 0xa2, subw 0x0, time 451137310, (-351,718), root:(613,761),
state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

You have a different keycode for KP_Enter and Return, maybe use xmodmap to make KP_Enter send keycode 36 instead? Not sure what that might break...
Maybe @dequis, @ailin-nemui or @ahf has some insight :)

Member

vague666 commented Oct 5, 2015

KeyPress event, serial 29, synthetic NO, window 0x4600001,
root 0xa2, subw 0x0, time 451133822, (-351,718), root:(613,761),
state 0x0, keycode 104 (keysym 0xff8d, KP_Enter), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

KeyPress event, serial 32, synthetic NO, window 0x4600001,
root 0xa2, subw 0x0, time 451137310, (-351,718), root:(613,761),
state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

You have a different keycode for KP_Enter and Return, maybe use xmodmap to make KP_Enter send keycode 36 instead? Not sure what that might break...
Maybe @dequis, @ailin-nemui or @ahf has some insight :)

@wodim

This comment has been minimized.

Show comment
Hide comment
@wodim

wodim Oct 5, 2015

I use Irssi through tmux+PuTTY on Windows.

On Mon, Oct 5, 2015 at 1:31 PM, Jari Matilainen notifications@github.com
wrote:

KeyPress event, serial 29, synthetic NO, window 0x4600001,
root 0xa2, subw 0x0, time 451133822, (-351,718), root:(613,761),
state 0x0, keycode 104 (keysym 0xff8d, KP_Enter), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

KeyPress event, serial 32, synthetic NO, window 0x4600001,
root 0xa2, subw 0x0, time 451137310, (-351,718), root:(613,761),
state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

You have a different keycode for KP_Enter and Return, maybe use xmodmap to
make KP_Enter send keycode 36 instead? Not sure what that might break...
Maybe @dequis https://github.com/dequis, @ailin-nemui
https://github.com/ailin-nemui or @ahf https://github.com/ahf has
some insight :)


Reply to this email directly or view it on GitHub
#327 (comment).

wodim commented Oct 5, 2015

I use Irssi through tmux+PuTTY on Windows.

On Mon, Oct 5, 2015 at 1:31 PM, Jari Matilainen notifications@github.com
wrote:

KeyPress event, serial 29, synthetic NO, window 0x4600001,
root 0xa2, subw 0x0, time 451133822, (-351,718), root:(613,761),
state 0x0, keycode 104 (keysym 0xff8d, KP_Enter), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

KeyPress event, serial 32, synthetic NO, window 0x4600001,
root 0xa2, subw 0x0, time 451137310, (-351,718), root:(613,761),
state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False

You have a different keycode for KP_Enter and Return, maybe use xmodmap to
make KP_Enter send keycode 36 instead? Not sure what that might break...
Maybe @dequis https://github.com/dequis, @ailin-nemui
https://github.com/ailin-nemui or @ahf https://github.com/ahf has
some insight :)


Reply to this email directly or view it on GitHub
#327 (comment).

@LemonBoy

This comment has been minimized.

Show comment
Hide comment
@LemonBoy

LemonBoy Oct 5, 2015

Member

That explains everything, that's a side effect of b5b73cb and the fact of using PuTTY.
You can find more informations here [1].

[1] http://vim.wikia.com/wiki/PuTTY_numeric_keypad_mappings

Member

LemonBoy commented Oct 5, 2015

That explains everything, that's a side effect of b5b73cb and the fact of using PuTTY.
You can find more informations here [1].

[1] http://vim.wikia.com/wiki/PuTTY_numeric_keypad_mappings

@wodim

This comment has been minimized.

Show comment
Hide comment
@wodim

wodim Oct 5, 2015

You are right, the following steps have solved it:

  1. Run PuTTY Configuration.
  2. In the left pane, select Terminal, Features.
  3. Put a check mark next to "Disable application keypad mode".
  4. In the left pane, select Session.
  5. Save the settings.

Is this considered a problem with PuTTY (and therefore I should close this) or not?

wodim commented Oct 5, 2015

You are right, the following steps have solved it:

  1. Run PuTTY Configuration.
  2. In the left pane, select Terminal, Features.
  3. Put a check mark next to "Disable application keypad mode".
  4. In the left pane, select Session.
  5. Save the settings.

Is this considered a problem with PuTTY (and therefore I should close this) or not?

@dequis

This comment has been minimized.

Show comment
Hide comment
@dequis

dequis Oct 5, 2015

Member

Checked with putty, what it sends is \x1bOM, or, in irssi keybinding terms, meta2-M

/bind meta2-M key return should fix it. Maybe adding that to the default keybindings is a good idea.


As an aside, some notes on how to debug this:

(gdb) break term_gets
Breakpoint 3 at 0x425060: file term-terminfo.c, line 653.
(gdb) c
Continuing.
$ xdotool sleep 2 key KP_Enter

(because i don't have a kp_enter key in my keyboard)

Breakpoint 3, term_gets (buffer=0xbd2830, line_count=line_count@entry=0x6e5248 <paste_line_count>) at term-terminfo.c:653
653     {
(gdb) fini
Run till exit from #0  term_gets (buffer=0xbd2830, line_count=line_count@entry=0x6e5248 <paste_line_count>) at term-terminfo.c:653
sig_input () at gui-readline.c:655
655                     if (paste_detect_time > 0 && paste_buffer->len >= 3) {
(gdb) p paste_buffer->len
$79 = 3
(gdb) p (unichar[3]) *paste_buffer->data
$80 = {27, 79, 77}
$ python
>>> chr(27) + chr(79) + chr(77)
'\x1bOM'
$ infocmp xterm
(...look for similar entries...)
$ infocmp -1 xterm | grep kent
        kent=\EOM,

It's a bit silly that the frontend claims to be terminfo based but doesn't use it at all for keybindings.

Member

dequis commented Oct 5, 2015

Checked with putty, what it sends is \x1bOM, or, in irssi keybinding terms, meta2-M

/bind meta2-M key return should fix it. Maybe adding that to the default keybindings is a good idea.


As an aside, some notes on how to debug this:

(gdb) break term_gets
Breakpoint 3 at 0x425060: file term-terminfo.c, line 653.
(gdb) c
Continuing.
$ xdotool sleep 2 key KP_Enter

(because i don't have a kp_enter key in my keyboard)

Breakpoint 3, term_gets (buffer=0xbd2830, line_count=line_count@entry=0x6e5248 <paste_line_count>) at term-terminfo.c:653
653     {
(gdb) fini
Run till exit from #0  term_gets (buffer=0xbd2830, line_count=line_count@entry=0x6e5248 <paste_line_count>) at term-terminfo.c:653
sig_input () at gui-readline.c:655
655                     if (paste_detect_time > 0 && paste_buffer->len >= 3) {
(gdb) p paste_buffer->len
$79 = 3
(gdb) p (unichar[3]) *paste_buffer->data
$80 = {27, 79, 77}
$ python
>>> chr(27) + chr(79) + chr(77)
'\x1bOM'
$ infocmp xterm
(...look for similar entries...)
$ infocmp -1 xterm | grep kent
        kent=\EOM,

It's a bit silly that the frontend claims to be terminfo based but doesn't use it at all for keybindings.

dequis added a commit to dequis/irssi that referenced this issue Oct 6, 2015

Add xterm's keypad enter, meta2-M to "key return" bindings
From the 'kent' terminfo entry. Also applies to putty.

Fixes #327

dequis added a commit to dequis/irssi that referenced this issue Oct 6, 2015

Add xterm's keypad enter, meta-O-M to "key return" bindings
From the 'kent' terminfo entry. Also applies to putty.

Fixes #327

@ailin-nemui ailin-nemui closed this in #330 Nov 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment