X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/59b0bfe7f0e692659cc84d7647f171f8fbd89eb9..720f700ea5af91c2faab20e74515f157e6e8cbdf:/macosx/osxwin.m diff --git a/macosx/osxwin.m b/macosx/osxwin.m index f61e6bff..7c9118b8 100644 --- a/macosx/osxwin.m +++ b/macosx/osxwin.m @@ -737,23 +737,8 @@ case NSLeftArrowFunctionKey: xkey = 'D'; break; } if (xkey) { - /* - * The arrow keys normally do ESC [ A and so on. In - * app cursor keys mode they do ESC O A instead. - * Ctrl toggles the two modes. - */ - if (term->vt52_mode) { - output[end++] = '\033'; - output[end++] = xkey; - } else if (!term->app_cursor_keys ^ !(m & NSControlKeyMask)) { - output[end++] = '\033'; - output[end++] = 'O'; - output[end++] = xkey; - } else { - output[end++] = '\033'; - output[end++] = '['; - output[end++] = xkey; - } + end += format_arrow_key(output+end, term, xkey, + m & NSControlKeyMask); goto done; } }