Rev 3923 | Rev 3933 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3923 | Rev 3924 | ||
|---|---|---|---|
| Line 24... | Line 24... | ||
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
27 | */ |
| 28 | 28 | ||
| 29 | /** @addtogroup kbd |
29 | /** @addtogroup kbd_ctl |
| 30 | * @brief PC keyboard controller driver. |
30 | * @ingroup kbd |
| 31 | * @{ |
31 | * @{ |
| 32 | */ |
32 | */ |
| - | 33 | /** |
|
| - | 34 | * @file |
|
| - | 35 | * @brief PC keyboard controller driver. |
|
| - | 36 | */ |
|
| 33 | 37 | ||
| 34 | #include <kbd.h> |
38 | #include <kbd.h> |
| 35 | #include <kbd/kbd.h> |
39 | #include <kbd/kbd.h> |
| 36 | #include <kbd/keycode.h> |
40 | #include <kbd/keycode.h> |
| 37 | #include <kbd_ctl.h> |
41 | #include <kbd_ctl.h> |
| 38 | 42 | ||
| 39 | int scanmap_simple[]; |
43 | static int scanmap_simple[]; |
| 40 | 44 | ||
| 41 | void kbd_ctl_parse_scancode(int scancode) |
45 | void kbd_ctl_parse_scancode(int scancode) |
| 42 | { |
46 | { |
| 43 | kbd_ev_type_t type; |
47 | kbd_ev_type_t type; |
| 44 | unsigned int key; |
48 | unsigned int key; |
| 45 | 49 | ||
| 46 | if (scancode < 0 || scancode >= 0x100) return; |
50 | if (scancode < 0 || scancode >= 0x100) |
| - | 51 | return; |
|
| 47 | 52 | ||
| 48 | if (scancode & 0x80) { |
53 | if (scancode & 0x80) { |
| 49 | scancode &= ~0x80; |
54 | scancode &= ~0x80; |
| 50 | type = KE_RELEASE; |
55 | type = KE_RELEASE; |
| 51 | } else { |
56 | } else { |
| Line 55... | Line 60... | ||
| 55 | key = scanmap_simple[scancode]; |
60 | key = scanmap_simple[scancode]; |
| 56 | if (key != 0) |
61 | if (key != 0) |
| 57 | kbd_push_ev(type, key, 0); |
62 | kbd_push_ev(type, key, 0); |
| 58 | } |
63 | } |
| 59 | 64 | ||
| 60 | int scanmap_simple[128] = { |
65 | static int scanmap_simple[128] = { |
| 61 | 66 | ||
| 62 | [0x29] = KC_BACKTICK, |
67 | [0x29] = KC_BACKTICK, |
| 63 | 68 | ||
| 64 | [0x02] = KC_1, |
69 | [0x02] = KC_1, |
| 65 | [0x03] = KC_2, |
70 | [0x03] = KC_2, |