added -r option

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8516 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2004-07-29 20:39:38 +00:00
parent 416e8e8104
commit 3a06d5ee6a
3 changed files with 20 additions and 6 deletions

View File

@ -18,6 +18,8 @@
#include <string.h>
#include <ByteOrder.h>
#include <File.h>
#include <FindDirectory.h>
#include <Path.h>
void
Keymap::GetKey( char *chars, int32 offset, char* string)
@ -538,9 +540,17 @@ Keymap::GetChars(uint32 keyCode, uint32 modifiers, uint8 activeDeadKey, char** c
status_t _restore_key_map_();
// we make our input server use the map in /boot/home/config/settings/Keymap
status_t
Keymap::Use()
void
Keymap::RestoreSystemDefault()
{
return _restore_key_map_();
BPath path;
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path)!=B_OK)
return;
path.Append("Key_map");
BEntry ref(path.Path());
ref.Remove();
_restore_key_map_();
}

View File

@ -31,7 +31,7 @@ public:
uint8 IsDeadKey(uint32 keyCode, uint32 modifiers);
bool IsDeadSecondKey(uint32 keyCode, uint32 modifiers, uint8 activeDeadKey);
void GetChars(uint32 keyCode, uint32 modifiers, uint8 activeDeadKey, char** chars, int32* numBytes);
status_t Use();
void RestoreSystemDefault();
static void GetKey( char *chars, int32 offset, char* string);
private:
char *fChars;

View File

@ -43,9 +43,13 @@ int main(int argc, char **argv)
keymap.Dump();
return 0;
}
if (operation == 'r') {
Keymap keymap;
keymap.RestoreSystemDefault();
return 0;
}
} else {
if (operation == 'o') {
//return do_compile(argv[i]);
return 0;
} else
break;