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 AROS_ENTRY(__startup
static ULONG
, Start
,
78 AROS_UFHA(char *, argstr
, A0
),
79 AROS_UFHA(ULONG
, argsize
, D0
),
80 struct ExecBase
*, SysBase
)
84 struct DosLibrary
*DOSBase
;
85 struct Library
*KeymapBase
;
86 struct KMSLibrary
*KMSBase
;
88 ULONG rc
= RETURN_FAIL
;
90 DOSBase
= (struct DosLibrary
*)OpenLibrary("dos.library", 36);
94 KeymapBase
= OpenLibrary("keymap.library", 0);
97 KMSBase
= (struct KMSLibrary
*)OpenLibrary("kms.library", 0);
101 struct RDArgs
*myargs
= ReadArgs(ARG_TEMPLATE
, args
, 0);
105 struct KeyMapNode
*kmn
= OpenKeymap((STRPTR
)args
[ARG_NAME
]);
109 SetKeyMapDefault(&kmn
->kn_KeyMap
);
115 PrintFault(IoErr(), "SetKeyboard");
120 CloseLibrary(&KMSBase
->kms_Lib
);
123 err
= "Can't opem kms.library!";
125 CloseLibrary(KeymapBase
);
128 err
= "Can't open keymap.library!";
131 Printf("SetKeyboard: %s\n", err
);
133 CloseLibrary(&DOSBase
->dl_lib
);