blob: 6ffbfb859ab89dc8eecffa049e2e267823af2a32 [file] [log] [blame]
Mathias Agopianb93a03f82012-02-17 15:34:57 -08001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080017#include <stdio.h>
Mathias Agopianb93a03f82012-02-17 15:34:57 -080018#include <androidfw/KeycodeLabels.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080019
20int
21main(int argc, char** argv)
22{
23 // TODO: Add full copyright.
24 printf("// Copyright (C) 2008 The Android Open Source Project\n");
25 printf("//\n");
26 printf("// This file is generated by makekeycodes from the definitions.\n");
27 printf("// in includes/ui/KeycodeLabels.h.\n");
28 printf("//\n");
29 printf("// If you modify this, your changes will be overwritten.\n");
30 printf("\n");
31 printf("pacakge android.os;\n");
32 printf("\n");
33 printf("public class KeyEvent\n");
34 printf("{\n");
35
36 for (int i=0; KEYCODES[i].literal != NULL; i++) {
37 printf(" public static final int KEYCODE_%s = 0x%08x;\n",
38 KEYCODES[i].literal, KEYCODES[i].value);
39 }
40
41 printf("\n");
42 for (int i=0; FLAGS[i].literal != NULL; i++) {
43 printf(" public static final int MODIFIER_%s = 0x%08x;\n",
44 FLAGS[i].literal, FLAGS[i].value);
45 }
46
47 printf("}\n");
48 return 0;
49}