X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=macosx%2Fosxwin.m;h=7c9118b82c5de0065c9ecd6cd34cbccfaa67fad0;hb=bb1d656dd4dac5594bf13717dac1e2512b311935;hp=f61e6bff73a9aee093e06cafb3cba06e08fe7872;hpb=46c00b0f381f48a9992e43e014e104015952e9da;p=PuTTY.git 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; } }