:github_url: https://github.com/nyx-org/gaia .. _program_listing_file_dev_console_ps2.hpp: Program Listing for File ps2.hpp ================================ |exhale_lsh| :ref:`Return to documentation for file ` (``dev/console/ps2.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace Gaia::Dev { class Ps2Controller : public Service { public: static void int_handler(Hal::InterruptFrame *frame, void *arg); void start(Service *provider) override; static Vm::UniquePtr init(); const char *class_name() override { return "Ps2Controller"; } const char *name() override { return name_str.data(); } private: AcpiDevice *acpi_device; frg::string name_str = ""; Hal::InterruptEntry int_entry; bool shift = false, capslock = false, ctrl = false; enum Scancode { MAX = 0x57, CTRL = 0x1d, CTRL_REL = 0x9d, SHIFT_RIGHT = 0x36, SHIFT_RIGHT_REL = 0xb6, SHIFT_LEFT = 0x2a, SHIFT_LEFT_REL = 0xaa, ALT_LEFT = 0x38, ALT_LEFT_REL = 0xb8, CAPSLOCK = 0x3a, NUMLOCK = 0x45, }; static constexpr auto CAPS_LOCK_LED_ENABLE = (1 << 2); }; void ps2_driver_register(); } // namespace Gaia::Dev