X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/bc6cd8b61639f18b4c24ee7aeae2412dbdbe3c0a..fc40b431a9049585675e171643eb308cc548713c:/macosx/osxwin.m diff --git a/macosx/osxwin.m b/macosx/osxwin.m index 361f548f..7c9118b8 100644 --- a/macosx/osxwin.m +++ b/macosx/osxwin.m @@ -232,15 +232,9 @@ /* * Set up a backend. */ - { - int i; + back = backend_from_proto(cfg.protocol); + if (!back) back = &pty_backend; - for (i = 0; backends[i].backend != NULL; i++) - if (backends[i].protocol == cfg.protocol) { - back = backends[i].backend; - break; - } - } { const char *error; @@ -743,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; } }