2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
9 /******************************************************************************
25 Set the keymap for the current shell.
29 KEYMAP -- the keymap to use with the current shell
35 To make a certain keymap be the default for all shells, use the
36 preferences input program so specify your default choice.
42 Makes the current shell use the Swedish keymap.
52 ******************************************************************************/
55 #include <exec/exec.h>
57 #include <devices/keymap.h>
58 #include <devices/console.h>
59 #include <devices/keymap.h>
60 #include <proto/exec.h>
61 #include <proto/dos.h>
62 #include <proto/keymap.h>
63 #include <proto/kms.h>
67 const TEXT version
[] = "$VER: SetKeyboard 41.3 (03.03.2011)\n";
69 #define ARG_TEMPLATE "KEYMAP/A"
77 __startup
AROS_PROCH(Start
, argstr
, argsize
, SysBase
)
81 struct DosLibrary
*DOSBase
;
82 struct Library
*KeymapBase
;
83 struct KMSLibrary
*KMSBase
;
85 ULONG rc
= RETURN_FAIL
;
87 DOSBase
= (struct DosLibrary
*)OpenLibrary("dos.library", 36);
91 KeymapBase
= OpenLibrary("keymap.library", 0);
94 KMSBase
= (struct KMSLibrary
*)OpenLibrary("kms.library", 0);
98 struct RDArgs
*myargs
= ReadArgs(ARG_TEMPLATE
, args
, 0);
102 struct KeyMapNode
*kmn
= OpenKeymap((STRPTR
)args
[ARG_NAME
]);
106 SetKeyMapDefault(&kmn
->kn_KeyMap
);
112 PrintFault(IoErr(), "SetKeyboard");
117 CloseLibrary(&KMSBase
->kms_Lib
);
120 err
= "Can't opem kms.library!";
122 CloseLibrary(KeymapBase
);
125 err
= "Can't open keymap.library!";
128 Printf("SetKeyboard: %s\n", err
);
130 CloseLibrary(&DOSBase
->dl_lib
);