MCPcopy Create free account
hub / github.com/NetHack/NetHack / optfn_altkeyhandling

Function optfn_altkeyhandling

src/options.c:1021–1063  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1019}
1020
1021staticfn int
1022optfn_altkeyhandling(
1023 int optidx UNUSED,
1024 int req,
1025 boolean negated,
1026 char *opts,
1027 char *op)
1028{
1029 if (req == do_init) {
1030 return optn_ok;
1031 }
1032 if (req == do_set) {
1033 /* altkeyhandling:string */
1034
1035#if defined(WIN32CON) && defined(TTY_GRAPHICS)
1036 if (op == empty_optstr || negated)
1037 return optn_err;
1038 set_altkeyhandling(op);
1039#else
1040 nhUse(negated);
1041 nhUse(op);
1042#endif
1043 return optn_ok;
1044 }
1045 if (req == get_val || req == get_cnf_val) {
1046 opts[0] = '\0';
1047#ifdef WIN32
1048 Sprintf(opts, "%s",
1049 (iflags.key_handling == nh340_keyhandling)
1050 ? "340"
1051 : (iflags.key_handling == ray_keyhandling)
1052 ? "ray"
1053 : "default");
1054#endif
1055 return optn_ok;
1056 }
1057#ifdef WIN32CON
1058 if (req == do_handler) {
1059 return set_keyhandling_via_option();
1060 }
1061#endif
1062 return optn_ok;
1063}
1064
1065staticfn int
1066optfn_autounlock(

Callers

nothing calls this directly

Calls 2

set_altkeyhandlingFunction · 0.85

Tested by

no test coverage detected