Full Code of mulaRahul/keyviz for AI

main 00c17a9ae366 cached
137 files
566.9 KB
149.7k tokens
639 symbols
1 requests
Download .txt
Showing preview only (604K chars total). Download the full file or copy to clipboard to get everything.
Repository: mulaRahul/keyviz
Branch: main
Commit: 00c17a9ae366
Files: 137
Total size: 566.9 KB

Directory structure:
gitextract_ox5y_6yy/

├── .github/
│   ├── FUNDING.yml
│   └── workflows/
│       └── winget.yml
├── .gitignore
├── .vscode/
│   └── extensions.json
├── LICENSE
├── README.md
├── components.json
├── index.html
├── package.json
├── src/
│   ├── App.css
│   ├── App.tsx
│   ├── components/
│   │   ├── custom-filter.tsx
│   │   ├── key-overlay.tsx
│   │   ├── keycaps/
│   │   │   ├── base.tsx
│   │   │   ├── index.tsx
│   │   │   ├── laptop.tsx
│   │   │   ├── lowprofile.tsx
│   │   │   ├── minimal.tsx
│   │   │   ├── pbt.tsx
│   │   │   └── press-count.tsx
│   │   ├── mouse-indicator.tsx
│   │   ├── mouse-overlay.tsx
│   │   ├── settings/
│   │   │   ├── about.tsx
│   │   │   ├── appearance.tsx
│   │   │   ├── general.tsx
│   │   │   ├── index.tsx
│   │   │   ├── keycap.tsx
│   │   │   └── mouse.tsx
│   │   ├── shortcut-recorder.tsx
│   │   ├── theme-mode-toggle.tsx
│   │   ├── theme-provider.tsx
│   │   └── ui/
│   │       ├── alert-dialog.tsx
│   │       ├── alignment-selector.tsx
│   │       ├── badge.tsx
│   │       ├── button-group.tsx
│   │       ├── button.tsx
│   │       ├── card.tsx
│   │       ├── collapsible.tsx
│   │       ├── color-picker.tsx
│   │       ├── combobox.tsx
│   │       ├── command.tsx
│   │       ├── dialog.tsx
│   │       ├── drawer.tsx
│   │       ├── dropdown-menu.tsx
│   │       ├── field.tsx
│   │       ├── gradient-picker.tsx
│   │       ├── icons.tsx
│   │       ├── input-group.tsx
│   │       ├── input.tsx
│   │       ├── item.tsx
│   │       ├── label.tsx
│   │       ├── multi-select.tsx
│   │       ├── number-input-buttons.tsx
│   │       ├── number-input-scrub.tsx
│   │       ├── number-input.tsx
│   │       ├── popover.tsx
│   │       ├── scroll-area.tsx
│   │       ├── select.tsx
│   │       ├── separator.tsx
│   │       ├── sheet.tsx
│   │       ├── sidebar-item.tsx
│   │       ├── skeleton.tsx
│   │       ├── slider.tsx
│   │       ├── sonner.tsx
│   │       ├── switch.tsx
│   │       ├── tabs.tsx
│   │       ├── textarea.tsx
│   │       ├── toggle-group.tsx
│   │       ├── toggle.tsx
│   │       └── tooltip.tsx
│   ├── lib/
│   │   ├── keymaps.ts
│   │   └── utils.ts
│   ├── main.tsx
│   ├── pages/
│   │   ├── settings.tsx
│   │   └── visualization.tsx
│   ├── stores/
│   │   ├── key_event.ts
│   │   ├── key_style.ts
│   │   ├── storage.ts
│   │   └── sync.ts
│   ├── types/
│   │   ├── event.ts
│   │   └── style.ts
│   └── vite-env.d.ts
├── src-tauri/
│   ├── .gitignore
│   ├── 2
│   ├── Cargo.toml
│   ├── build.rs
│   ├── capabilities/
│   │   └── default.json
│   ├── crates/
│   │   └── rdev/
│   │       ├── .gitignore
│   │       ├── Cargo.toml
│   │       ├── LICENSE
│   │       ├── README.md
│   │       ├── rustfmt.toml
│   │       └── src/
│   │           ├── codes_conv.rs
│   │           ├── keycodes/
│   │           │   ├── android.rs
│   │           │   ├── chrome.rs
│   │           │   ├── linux.rs
│   │           │   ├── macos.rs
│   │           │   ├── macos_virtual_keycodes.rs
│   │           │   ├── mod.rs
│   │           │   ├── usb_hid.rs
│   │           │   └── windows.rs
│   │           ├── lib.rs
│   │           ├── linux/
│   │           │   ├── common.rs
│   │           │   ├── display.rs
│   │           │   ├── grab.rs
│   │           │   ├── keyboard.rs
│   │           │   ├── listen.rs
│   │           │   ├── mod.rs
│   │           │   └── simulate.rs
│   │           ├── macos/
│   │           │   ├── common.rs
│   │           │   ├── display.rs
│   │           │   ├── grab.rs
│   │           │   ├── keyboard.rs
│   │           │   ├── listen.rs
│   │           │   ├── mod.rs
│   │           │   └── simulate.rs
│   │           ├── rdev.rs
│   │           └── windows/
│   │               ├── common.rs
│   │               ├── display.rs
│   │               ├── grab.rs
│   │               ├── keyboard.rs
│   │               ├── listen.rs
│   │               ├── mod.rs
│   │               └── simulate.rs
│   ├── icons/
│   │   └── icon.icns
│   ├── src/
│   │   ├── app/
│   │   │   ├── commands.rs
│   │   │   ├── event.rs
│   │   │   ├── mod.rs
│   │   │   ├── state.rs
│   │   │   └── window.rs
│   │   ├── lib.rs
│   │   └── main.rs
│   ├── tauri.conf.json
│   └── tauri.windows.conf.json
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/FUNDING.yml
================================================
github: [mulaRahul]

================================================
FILE: .github/workflows/winget.yml
================================================
name: Publish to Winget

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: vedantmgoyal2009/winget-releaser@v2
        with:
          identifier: mulaRahul.Keyviz
          token: ${{ secrets.WINGET_TOKEN }}

================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?


================================================
FILE: .vscode/extensions.json
================================================
{
  "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
}


================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    Keyviz visualizes your keystrokes in real-time.
    Copyright (C) 2022  Rahul Mula

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    Keyviz  Copyright (C) 2023  Rahul Mula
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

================================================
FILE: README.md
================================================
# [Keyviz](https://keyviz.org)

<div>
   <img src="https://img.shields.io/github/v/release/mulaRahul/keyviz?style=flat-square" alt="Releases">
   <img src="https://img.shields.io/github/downloads/mulaRahul/keyviz/total?style=flat-square" alt="Downloads">
   <img src="https://img.shields.io/github/stars/mulaRahul/keyviz?style=flat-square" alt="Stars">
   <img src="https://img.shields.io/github/license/mulaRahul/keyviz?style=flat-square" alt="License">
   <img src="https://img.shields.io/badge/platform-Windows%20%7C%20macOS-lightgrey?style=flat-square" alt="Platform Support">
</div>

Keyviz is a **free and open-source** tool that visualizes your keypresses and mouse actions in real-time. Let your audience know what handy shortcuts you're pressing during tutorials, presentations, collaborations, or whenever you need.

## ⌨️ Keypress & 🖱️ Mouse Actions
Along with normal keys, you can also visualize mouse actions like <kbd>Cmd</kbd> + <kbd>Click</kbd>, <kbd>Alt</kbd> + <kbd>Drag</kbd>, etc.

<img src="previews/visualization.png" alt="Keystroke Visualization" width="450">

Display mouse clicks and scroll wheel movements alongside your cursor.

<img src="previews/mouse-indicator.gif" alt="Mouse Indicator" width="450">

</br>

## ⚙️ Full Customization
Don't settle for defaults. Every aspect of the visualization is under your control:
- **Styling:** Change colors (modifier vs. regular keys), size, layout, border, and background.
- **Filtering:** Control which keys are shown using hotkey or custom filters.
- **History:** Keep a visual trail of your recent inputs.
- **Position:** Move the visualization to any part of your screen.
- **Animations:** Customize how inputs appear and disappear with preset entry and exit animations.

</br>

<img src="previews/settings.png" alt="Settings Panel" width="600">

</br>

## 📥 Installation

### Windows & macOS
You can download the latest version of Keyviz from the **[GitHub Releases](https://github.com/mulaRahul/keyviz/releases)** page.

*   **Windows:** Download the `.msi` installer, run it, and follow the steps.
*   **macOS:** Download the `.dmg`. 
    **Note:** Keyviz requires **Input Monitoring** and **Accessibility** permissions. Enable them here:
    `Settings > Privacy & Security > Input Monitoring & Accessibility`

### Linux (x11)
Keyviz is compatible with Linux using the X11 protocol. Currently, you can try it out by following the build instructions below.

</br>

## 🛠️ Build Instructions

If you want to contribute or build the latest features from the source, ensure you have [Node.js](https://nodejs.org/) and [Tauri](https://v2.tauri.app/start) set up on your system.

1.  **Clone the repository:**
    ```bash
    git clone https://github.com/mulaRahul/keyviz.git
    cd keyviz
    ```

2.  **Install dependencies:**
    ```bash
    npm install
    ```

3.  **Build the executable:**
    ```bash
    npx tauri build
    ```

<br/>


## 💖 Support the Project

*   **Star the Repo:** It helps others discover the project!
*   **GitHub Sponsors:** [Sponsor @mularahul](https://github.com/sponsors/mulaRahul)
*   **Keyviz Pro:** Get access to exclusive features while supporting the development of this open-source project.

👉 **[Upgrade to Pro at keyviz.org/pro](https://keyviz.org/pro)**

</br>

---

  Built with 🦀 and ❤️ using <a href="https://v2.tauri.app/">Tauri</a>.


================================================
FILE: components.json
================================================
{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "base-nova",
  "rsc": false,
  "tsx": true,
  "tailwind": {
    "config": "",
    "css": "src/App.css",
    "baseColor": "neutral",
    "cssVariables": true,
    "prefix": ""
  },
  "iconLibrary": "hugeicons",
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils",
    "ui": "@/components/ui",
    "lib": "@/lib",
    "hooks": "@/hooks"
  },
  "menuColor": "default",
  "menuAccent": "subtle",
  "registries": {}
}


================================================
FILE: index.html
================================================
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Keyviz</title>
  </head>

  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>


================================================
FILE: package.json
================================================
{
  "name": "keyviz",
  "private": true,
  "version": "0.1.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "preview": "vite preview",
    "tauri": "tauri"
  },
  "dependencies": {
    "@ark-ui/react": "^5.30.0",
    "@base-ui/react": "^1.0.0",
    "@fontsource-variable/inter": "^5.2.8",
    "@hugeicons/core-free-icons": "^3.1.0",
    "@hugeicons/react": "^1.1.4",
    "@tailwindcss/vite": "^4.1.18",
    "@tauri-apps/api": "^2",
    "@tauri-apps/plugin-dialog": "^2.4.2",
    "@tauri-apps/plugin-fs": "^2.4.4",
    "@tauri-apps/plugin-opener": "^2.5.2",
    "@tauri-apps/plugin-os": "^2.3.2",
    "@tauri-apps/plugin-store": "^2.4.1",
    "class-variance-authority": "^0.7.1",
    "clsx": "^2.1.1",
    "cmdk": "^1.1.1",
    "colord": "^2.9.3",
    "embla-carousel-react": "^8.6.0",
    "hugeicons-react": "^0.3.0",
    "input-otp": "^1.4.2",
    "lucide-react": "^0.562.0",
    "motion": "^12.23.26",
    "next-themes": "^0.4.6",
    "radix-ui": "^1.4.3",
    "react": "^19.1.0",
    "react-aria-components": "^1.14.0",
    "react-day-picker": "^9.13.0",
    "react-dom": "^19.1.0",
    "react-resizable-panels": "^4.0.15",
    "react-router-dom": "^7.11.0",
    "recharts": "^3.6.0",
    "shadcn": "^3.6.2",
    "sonner": "^2.0.7",
    "tailwind-merge": "^3.4.0",
    "tailwindcss": "^4.1.18",
    "vaul": "^1.1.2",
    "zustand": "^5.0.9"
  },
  "devDependencies": {
    "@tauri-apps/cli": "^2",
    "@types/node": "^25.0.3",
    "@types/react": "^19.1.8",
    "@types/react-dom": "^19.1.6",
    "@vitejs/plugin-react": "^4.6.0",
    "tw-animate-css": "^1.4.0",
    "typescript": "~5.8.3",
    "vite": "^7.0.4"
  }
}


================================================
FILE: src/App.css
================================================
@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
@import "@fontsource-variable/inter";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);
  --radius-4xl: calc(var(--radius) + 16px);
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
  --font-sans: 'Inter Variable', sans-serif;
}

:root {
  --radius: 0.625rem;
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.58 0.22 27);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.809 0.105 251.813);
  --chart-2: oklch(0.623 0.214 259.815);
  --chart-3: oklch(0.546 0.245 262.881);
  --chart-4: oklch(0.488 0.243 264.376);
  --chart-5: oklch(0.424 0.199 265.638);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);

  --highlight-color: #fff;
  --shadow-color: oklch(80% 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.87 0.00 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.371 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.809 0.105 251.813);
  --chart-2: oklch(0.623 0.214 259.815);
  --chart-3: oklch(0.546 0.245 262.881);
  --chart-4: oklch(0.488 0.243 264.376);
  --chart-5: oklch(0.424 0.199 265.638);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
  
  --highlight-color: #666;
  --shadow-color: #000;
}

@layer base {
  * {
    @apply border-border outline-ring/50;
    @apply border-border outline-ring/50;
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
    @apply font-sans bg-background text-foreground;
    @apply font-sans bg-background text-foreground;
  }
  html {
    @apply font-sans;
    @apply font-sans;
  }
}

body {
  background-color: transparent;
}

================================================
FILE: src/App.tsx
================================================
import "./App.css";

import { Suspense, lazy } from "react";
import { HashRouter, Route, Routes } from "react-router-dom";
import { ThemeProvider } from "./components/theme-provider";
import { Toaster } from "./components/ui/sonner";
import { Visualization } from "./pages/visualization";

const Settings = lazy(() => import("./pages/settings"));

function App() {
  return (
    <HashRouter>
      <Suspense fallback={<div>Loading...</div>}>
        <Routes>
          <Route path="/" element={<Visualization />} />
          <Route path="/settings" element={
            <ThemeProvider>
              <Settings />
              <Toaster position="bottom-right" />
            </ThemeProvider>
          } />
        </Routes>
      </Suspense>
    </HashRouter>
  );
}

export default App;


================================================
FILE: src/components/custom-filter.tsx
================================================
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { keymaps } from "@/lib/keymaps";
import { cn } from "@/lib/utils";
import { useKeyEvent } from "@/stores/key_event";
import { RawKey } from "@/types/event";
import { createContext, useContext, useEffect, useRef, useState } from "react";

// Context for shared state
interface KeyboardContextType {
  isCtrlHeld: boolean;
  hoveredKey: string | undefined;
  hoveredCategory: string | undefined;
  setHoveredKey: (key: string | undefined) => void;
  setHoveredCategory: (category: string | undefined) => void;
}

const KeyboardContext = createContext<KeyboardContextType | null>(null);

// Reusable Key Component to avoid repeating Tailwind classes
const ButtonKey: React.FC<{
  rawKey: string;
  className?: string;
  flexGrow?: boolean;
}> = ({ rawKey, className = "", flexGrow = false }) => {
  const allowedKeys = useKeyEvent(state => state.allowedKeys);
  const setAllowedKeys = useKeyEvent(state => state.setAllowedKeys);
  const context = useContext(KeyboardContext);

  if (!context) {
    throw new Error('ButtonKey must be used within KeyboardContext');
  }

  const { isCtrlHeld, hoveredCategory, setHoveredKey } = context;

  const keyData = keymaps[rawKey];
  const displayLabel = keyData?.shortLabel || keyData?.label || rawKey;
  const symbol = keyData?.symbol;
  const category = keyData?.category;
  const enabled = allowedKeys.includes(rawKey);
  const isHighlighted = isCtrlHeld && hoveredCategory && category === hoveredCategory;

  let content = <>{displayLabel}</>;
  if (symbol) {
    content = <>{symbol}<br />{displayLabel}</>;
  } else if (keyData?.category === 'arrow') {
    content = <>{keyData.glyph}</>;
  }

  const handleClick = () => {
    if (isCtrlHeld && category) {
      // Toggle all keys in the category
      const keysInCategory = Object.keys(keymaps).filter(
        k => keymaps[k]?.category === category
      );

      // Check if all keys in the category are enabled
      const allEnabled = keysInCategory.every(k => allowedKeys.includes(k));

      if (allEnabled) {
        // Remove all keys in the category
        setAllowedKeys(allowedKeys.filter(k => !keysInCategory.includes(k)));
      } else {
        // Add all keys in the category
        const newKeys = [...allowedKeys];
        keysInCategory.forEach(k => {
          if (!newKeys.includes(k)) {
            newKeys.push(k);
          }
        });
        setAllowedKeys(newKeys);
      }
    } else {
      // Toggle single key
      if (allowedKeys.includes(rawKey)) {
        setAllowedKeys(allowedKeys.filter(k => k !== rawKey));
      } else {
        setAllowedKeys([...allowedKeys, rawKey]);
      }
    }
  };

  return (
    <div
      onClick={handleClick}
      onMouseEnter={() => setHoveredKey(rawKey)}
      onMouseLeave={() => setHoveredKey(undefined)}
      className={cn(
        !flexGrow && 'w-10 h-10',
        'flex items-center justify-center text-xs text-primary text-center bg-secondary rounded-lg cursor-pointer',
        className,
        !enabled && 'opacity-50',
        isHighlighted ? 'outline-2 outline-blue-500' : 'hover:outline-2 hover:outline-blue-500'
      )}
      style={{
        boxShadow: enabled
          ? '0 1px 2px 0 var(--shadow-color), inset 0 1px 1px 0 var(--highlight-color)'
          : '0 1px 2px 0 var(--shadow-color) inset',
      }}
    >
      {content}
    </div>
  );
};

export const CustomFilter = () => {
  const [activeTab, setActiveTab] = useState<'Keyboard' | 'Mouse' | 'Numpad'>('Keyboard');
  const [isCtrlHeld, setIsCtrlHeld] = useState(false);
  const [hoveredKey, setHoveredKey] = useState<string | undefined>(undefined);
  const [hoveredCategory, setHoveredCategory] = useState<string | undefined>(undefined);

  const hoveredKeyRef = useRef<string | undefined>(undefined);

  useEffect(() => {
    const handleKeyDown = (e: KeyboardEvent) => {
      if (!e.repeat && e.key === 'Control') {
        setIsCtrlHeld(true);
        const currentHoveredKey = hoveredKeyRef.current;
        setHoveredCategory(currentHoveredKey ? keymaps[currentHoveredKey]?.category : undefined);
      }
    };

    const handleKeyUp = (e: KeyboardEvent) => {
      if (e.key === 'Control') {
        setIsCtrlHeld(false);
        setHoveredCategory(undefined);
      }
    };

    window.addEventListener('keydown', handleKeyDown);
    window.addEventListener('keyup', handleKeyUp);

    return () => {
      window.removeEventListener('keydown', handleKeyDown);
      window.removeEventListener('keyup', handleKeyUp);
    };
  }, []);

  useEffect(() => {
    hoveredKeyRef.current = hoveredKey;
  }, [hoveredKey]);

  return (
    <KeyboardContext.Provider value={{ isCtrlHeld, hoveredKey, hoveredCategory, setHoveredKey, setHoveredCategory }}>
      <div className="w-full h-100 flex flex-col gap-4 items-center justify-center">
        {activeTab === 'Keyboard' &&
          <div
            className="w-full p-3 max-w-196 flex flex-col gap-2 bg-secondary rounded-2xl"
          >
            {/* Row 1: Function Keys */}
            <div className="flex gap-2 justify-between w-full">
              <ButtonKey rawKey={RawKey.Escape} />
              <ButtonKey rawKey={RawKey.F1} />
              <ButtonKey rawKey={RawKey.F2} />
              <ButtonKey rawKey={RawKey.F3} />
              <ButtonKey rawKey={RawKey.F4} />
              <ButtonKey rawKey={RawKey.F5} />
              <ButtonKey rawKey={RawKey.F6} />
              <ButtonKey rawKey={RawKey.F7} />
              <ButtonKey rawKey={RawKey.F8} />
              <ButtonKey rawKey={RawKey.F9} />
              <ButtonKey rawKey={RawKey.F10} />
              <ButtonKey rawKey={RawKey.F11} />
              <ButtonKey rawKey={RawKey.F12} />
              <ButtonKey rawKey={RawKey.Insert} />
              <ButtonKey rawKey={RawKey.Delete} />
            </div>

            {/* Row 2: Numbers */}
            <div className="flex gap-2 justify-between w-full">
              <ButtonKey rawKey={RawKey.BackQuote} />
              <ButtonKey rawKey={RawKey.Num1} />
              <ButtonKey rawKey={RawKey.Num2} />
              <ButtonKey rawKey={RawKey.Num3} />
              <ButtonKey rawKey={RawKey.Num4} />
              <ButtonKey rawKey={RawKey.Num5} />
              <ButtonKey rawKey={RawKey.Num6} />
              <ButtonKey rawKey={RawKey.Num7} />
              <ButtonKey rawKey={RawKey.Num8} />
              <ButtonKey rawKey={RawKey.Num9} />
              <ButtonKey rawKey={RawKey.Num0} />
              <ButtonKey rawKey={RawKey.Minus} />
              <ButtonKey rawKey={RawKey.Equal} />
              <ButtonKey rawKey={RawKey.Backspace} className="flex-2" flexGrow />
              <ButtonKey rawKey={RawKey.Home} />
            </div>

            {/* Row 3: QWERTY */}
            <div className="flex gap-2 justify-between w-full">
              <ButtonKey rawKey={RawKey.Tab} className="flex-3" flexGrow />
              <ButtonKey rawKey={RawKey.KeyQ} />
              <ButtonKey rawKey={RawKey.KeyW} />
              <ButtonKey rawKey={RawKey.KeyE} />
              <ButtonKey rawKey={RawKey.KeyR} />
              <ButtonKey rawKey={RawKey.KeyT} />
              <ButtonKey rawKey={RawKey.KeyY} />
              <ButtonKey rawKey={RawKey.KeyU} />
              <ButtonKey rawKey={RawKey.KeyI} />
              <ButtonKey rawKey={RawKey.KeyO} />
              <ButtonKey rawKey={RawKey.KeyP} />
              <ButtonKey rawKey={RawKey.LeftBracket} />
              <ButtonKey rawKey={RawKey.RightBracket} />
              <ButtonKey rawKey={RawKey.BackSlash} className="flex-2" />
              <ButtonKey rawKey={RawKey.End} />
            </div>

            {/* Row 4: ASDF */}
            <div className="flex gap-2 justify-between w-full">
              <ButtonKey rawKey={RawKey.CapsLock} className="flex-4" flexGrow />
              <ButtonKey rawKey={RawKey.KeyA} />
              <ButtonKey rawKey={RawKey.KeyS} />
              <ButtonKey rawKey={RawKey.KeyD} />
              <ButtonKey rawKey={RawKey.KeyF} />
              <ButtonKey rawKey={RawKey.KeyG} />
              <ButtonKey rawKey={RawKey.KeyH} />
              <ButtonKey rawKey={RawKey.KeyJ} />
              <ButtonKey rawKey={RawKey.KeyK} />
              <ButtonKey rawKey={RawKey.KeyL} />
              <ButtonKey rawKey={RawKey.SemiColon} />
              <ButtonKey rawKey={RawKey.Quote} />
              <ButtonKey rawKey={RawKey.Return} className="flex-4" flexGrow />
              <ButtonKey rawKey={RawKey.PageUp} />
            </div>

            {/* Row 5: ZXCV */}
            <div className="flex gap-2 justify-between w-full">
              <ButtonKey rawKey={RawKey.ShiftLeft} className="flex-5" flexGrow />
              <ButtonKey rawKey={RawKey.KeyZ} />
              <ButtonKey rawKey={RawKey.KeyX} />
              <ButtonKey rawKey={RawKey.KeyC} />
              <ButtonKey rawKey={RawKey.KeyV} />
              <ButtonKey rawKey={RawKey.KeyB} />
              <ButtonKey rawKey={RawKey.KeyN} />
              <ButtonKey rawKey={RawKey.KeyM} />
              <ButtonKey rawKey={RawKey.Comma} />
              <ButtonKey rawKey={RawKey.Dot} />
              <ButtonKey rawKey={RawKey.Slash} />
              <ButtonKey rawKey={RawKey.ShiftRight} className="flex-4" flexGrow />
              <ButtonKey rawKey={RawKey.UpArrow} />
              <ButtonKey rawKey={RawKey.PageDown} />
            </div>

            {/* Row 6: Bottom & Arrows */}
            <div className="flex gap-2 justify-between h-12 w-full">
              <ButtonKey rawKey={RawKey.ControlLeft} className="flex-1" />
              <ButtonKey rawKey={RawKey.Alt} className="flex-1" />
              <ButtonKey rawKey={RawKey.MetaLeft} className="flex-1" />
              <ButtonKey rawKey={RawKey.Space} className="flex-4" flexGrow />
              <ButtonKey rawKey={RawKey.ControlRight} className="flex-1" />
              <ButtonKey rawKey={RawKey.LeftArrow} />
              <ButtonKey rawKey={RawKey.DownArrow} />
              <ButtonKey rawKey={RawKey.RightArrow} />
            </div>
          </div>
        }
        {
          activeTab === 'Mouse' &&
          <div
            className="h-fit w-fit p-5 grid grid-cols-3 gap-4 justify-center bg-secondary rounded-t-[44%] rounded-b-[40%]"
          >
            <ButtonKey rawKey={RawKey.Left} className="mt-7" />
            <div className="flex flex-col gap-4 items-center">
              <ButtonKey rawKey={RawKey.Middle} />
              <ButtonKey rawKey={RawKey.ScrollUp} />
              <ButtonKey rawKey={RawKey.ScrollDown} />
              <ButtonKey rawKey={RawKey.Drag} />
            </div>
            <ButtonKey rawKey={RawKey.Right} className="mt-7" />
          </div>
        }
        {
          activeTab === 'Numpad' &&
          <div
            className="w-56 p-3 grid grid-cols-4 gap-2 bg-secondary rounded-2xl"
          >
            {/* Row 1 */}
            <ButtonKey rawKey={RawKey.NumLock} />
            <ButtonKey rawKey={RawKey.KpDivide} />
            <ButtonKey rawKey={RawKey.KpMultiply} />
            <ButtonKey rawKey={RawKey.KpMinus} />

            {/* Row 2 */}
            <ButtonKey rawKey={RawKey.Kp7} />
            <ButtonKey rawKey={RawKey.Kp8} />
            <ButtonKey rawKey={RawKey.Kp9} />
            <ButtonKey rawKey={RawKey.KpPlus} className="row-span-2" flexGrow />

            {/* Row 3 */}
            <ButtonKey rawKey={RawKey.Kp4} />
            <ButtonKey rawKey={RawKey.Kp5} />
            <ButtonKey rawKey={RawKey.Kp6} />
            {/* <div /> */}

            {/* Row 4 */}
            <ButtonKey rawKey={RawKey.Kp3} />
            <ButtonKey rawKey={RawKey.Kp2} />
            <ButtonKey rawKey={RawKey.Kp1} />
            <ButtonKey rawKey={RawKey.KpReturn} className="row-span-2" flexGrow />

            {/* Row 5 */}
            <ButtonKey className="col-span-2" rawKey={RawKey.Kp0} flexGrow />
            <ButtonKey rawKey={RawKey.KpDecimal} />
            <div />
          </div>
        }

        <ToggleGroup
          type="single"
          spacing={4}
          className="p-1 border rounded-xl"
          value={activeTab}
          onValueChange={(value) => setActiveTab(value as 'Keyboard' | 'Mouse' | 'Numpad')}
        >
          <ToggleGroupItem value="Keyboard">Keyboard</ToggleGroupItem>
          <ToggleGroupItem value="Mouse">Mouse</ToggleGroupItem>
          <ToggleGroupItem value="Numpad">Numpad</ToggleGroupItem>
        </ToggleGroup>
      </div>
    </KeyboardContext.Provider>
  );
};

================================================
FILE: src/components/key-overlay.tsx
================================================
import { easeInQuint, easeOutQuint } from "@/lib/utils";
import { useKeyEvent } from "@/stores/key_event";
import { useKeyStyle } from "@/stores/key_style";
import { alignmentForColumn, alignmentForRow } from "@/types/style";
import { AnimatePresence, motion, Variants } from "motion/react";
import { useMemo } from "react";
import { Keycap } from "./keycaps";


const fadeVariants: Variants = {
    visible: { opacity: 1 },
    hidden: { opacity: 0 },
}

export const KeyOverlay = () => {
    const pressedKeys = useKeyEvent(state => state.pressedKeys);
    const groups = useKeyEvent(state => state.groups);
    const showHistory = useKeyEvent(state => state.showEventHistory);

    const appearance = useKeyStyle(state => state.appearance);
    const text = useKeyStyle(state => state.text);
    const border = useKeyStyle(state => state.border);
    const background = useKeyStyle(state => state.background);

    const alignment = appearance.flexDirection === "row"
        ? alignmentForRow[appearance.alignment]
        : alignmentForColumn[appearance.alignment];

    const containerStyle = {
        flexDirection: appearance.flexDirection,
        paddingBlock: appearance.marginY,
        paddingInline: appearance.marginX,
        alignItems: alignment.alignItems,
        justifyContent: alignment.justifyContent,
        gap: text.size * 0.5,
    };

    const groupStyle = {
        display: "flex",
        columnGap: appearance.style === "minimal" ? text.size * 0.15 : text.size * 0.3,
        ...(background.enabled && {
            paddingInline: text.size * 0.4,
            paddingBlock: appearance.style === "minimal" ? text.size * 0.25 : text.size * 0.4,
            background: background.color,
            borderRadius: border.radius * (text.size * 1.75),
        }),
    }

    const variants = useMemo<Variants>(() => {
        switch (appearance.animation) {
            case "none":
                return {
                    visible: {},
                    hidden: {}
                };
            case "fade":
                return fadeVariants;
            case "zoom":
                return {
                    visible: { scale: 1, opacity: 1 },
                    hidden: { scale: 0, opacity: 0 }
                };
            case "float":
                return {
                    visible: { opacity: 1, y: 0 },
                    hidden: { opacity: 0, y: text.size }
                };
            case "slide":
                return {
                    visible: { opacity: 1, x: 0 },
                    hidden: { opacity: 0, x: text.size }
                };
        }
    }, [appearance.animation, text.size]);

    if (appearance.animation === "none") {
        return (
            <div className="w-full h-full flex" style={containerStyle}>
                {groups.map((group, groupIndex) => (
                    <div
                        key={group.createdAt}
                        style={groupStyle}
                        className={background.enabled ? "overflow-hidden" : ""}
                    >
                        {group.keys.map((event, keyIndex) => (
                            <Keycap
                                key={event.name}
                                event={event}
                                lastest={group.keys.length - 1 === keyIndex}
                                isPressed={groups.length - 1 === groupIndex && event.in(pressedKeys)}
                            />
                        ))}
                    </div>
                ))}
            </div>
        );
    }

    return (
        <div className="w-full h-full flex" style={containerStyle}>
            <AnimatePresence>
                {groups.map((group, groupIndex) => (
                    <motion.div
                        key={group.createdAt}
                        layout={showHistory ? "position" : false}
                        variants={fadeVariants}
                        initial="hidden"
                        animate="visible"
                        exit="hidden"
                        style={groupStyle}
                        className={background.enabled ? "overflow-hidden" : ""}
                        transition={{
                            ease: [easeOutQuint, easeInQuint],
                            duration: showHistory ? appearance.animationDuration : 0
                        }}
                    >
                        <AnimatePresence>
                            {group.keys.map((event, keyIndex) => (
                                <motion.div
                                    key={event.name}
                                    layout="position"
                                    variants={variants}
                                    initial="hidden"
                                    animate="visible"
                                    exit="hidden"
                                    transition={{
                                        ease: [easeOutQuint, easeInQuint],
                                        duration: appearance.animationDuration,
                                        layout: { duration: appearance.animationDuration / 3, ease: easeOutQuint },
                                    }}
                                >
                                    <Keycap
                                        event={event}
                                        lastest={group.keys.length - 1 === keyIndex}
                                        isPressed={groups.length - 1 === groupIndex && event.in(pressedKeys)}
                                    />
                                </motion.div>
                            ))}
                        </AnimatePresence>
                    </motion.div>
                ))}
            </AnimatePresence>
        </div>
    );
};

================================================
FILE: src/components/keycaps/base.tsx
================================================
import { keymaps } from "@/lib/keymaps";
import { useKeyStyle } from "@/stores/key_style";
import { KeyEvent } from "@/types/event";
import { alignmentForRow } from "@/types/style";

export const KeycapBase = ({ event }: { event: KeyEvent }) => {
  const text = useKeyStyle((state) => state.text);
  const layout = useKeyStyle((state) => state.layout);
  const modifier = useKeyStyle((state) => state.modifier);
  const display = keymaps[event.name];

  const textColor = event.isModifier() && modifier.highlight ? modifier.textColor : text.color;
  const textStyle: React.CSSProperties = {
    color: textColor,
    lineHeight: 1.2,
    fontSize: text.size,
    textTransform: text.caps,
  };

  const label = text.variant === "text-short"
    ? display.shortLabel ?? display.label
    : display.label;

  const flexAlignment = alignmentForRow[text.alignment];

  // ───────────── With Icon ─────────────
  if (layout.showIcon && display.icon) {
    const Icon = display.icon;
    if (text.variant === "icon" || event.isArrow()) {
      return <div 
        className="w-full h-full flex"
        style={{ alignItems: flexAlignment.alignItems, justifyContent: flexAlignment.justifyContent }}
      >
        <Icon color={textColor} size={text.size * 0.8} />
      </div>;
    } else {
      const alignItems = event.isModifier()
        ? layout.iconAlignment
        // flip alignment for column
        : flexAlignment.justifyContent;
      return <div
        className="w-full h-full flex flex-col justify-between"
        style={{ alignItems }}
      >
        <Icon color={textColor} size={text.size * 0.5} />
        <div style={{ ...textStyle, fontSize: text.size * 0.5 }}>
          {label}
        </div>
      </div>;
    }
  }
  // ───────────── With Symbol ─────────────
  else if (layout.showSymbol && display.symbol) {
    return <div
      className="w-full h-full flex flex-col"
      style={{
        ...textStyle,
        lineHeight: 1.4,
        fontSize: text.size * 0.56,
        alignItems: flexAlignment.justifyContent,
        justifyContent: flexAlignment.alignItems
      }}
    >
      <span>{display.symbol}</span>
      <span className="font-semibold">{display.label}</span>
    </div>
  }
  // ───────────── Numpad ─────────────
  else if (event.isNumpad()) {
    return <div
      className="w-full h-full flex flex-col justify-between"
      style={{
        ...textStyle,
        fontSize: text.size * 0.5,
        alignItems: flexAlignment.alignItems,
        justifyContent: flexAlignment.justifyContent
      }}
    >
      <div>{label}</div>
      {
        display.symbol && <div>{display.symbol}</div>
      }
    </div>;
  }
  // ───────────── Text Only ─────────────
  return (
    <div
      className="w-full h-full flex"
      style={{ ...textStyle, alignItems: flexAlignment.alignItems, justifyContent: flexAlignment.justifyContent }}
    >
      {label}
    </div>
  );
}

================================================
FILE: src/components/keycaps/index.tsx
================================================
import { useKeyStyle } from "@/stores/key_style";
import { KeyEvent } from "@/types/event";
import { LowProfileKeycap } from "./lowprofile";
import { LaptopKeycap } from "./laptop";
import { MinimalKeycap } from "./minimal";
import { PBTKeycap } from "./pbt";

export interface KeycapProps {
    event: KeyEvent;
    isPressed: boolean;
    lastest: boolean;
}

const components = {
    minimal: MinimalKeycap,
    laptop: LaptopKeycap,
    lowprofile: LowProfileKeycap,
    pbt: PBTKeycap,
} as const;

export const Keycap = (props: KeycapProps) => {
    const style = useKeyStyle(state => state.appearance.style);
    const KeycapComponent = components[style];
    
    return <KeycapComponent {...props} />;
};


================================================
FILE: src/components/keycaps/laptop.tsx
================================================
import { darken, lighten } from "@/lib/utils";
import { useKeyStyle } from "@/stores/key_style";
import type { KeycapProps } from ".";
import { KeycapBase } from "./base";
import { PressCount } from "./press-count";

export const LaptopKeycap = ({ event, lastest, isPressed }: KeycapProps) => {
    const color = useKeyStyle((state) => state.color);
    const text = useKeyStyle((state) => state.text);
    const border = useKeyStyle((state) => state.border);
    const modifier = useKeyStyle((state) => state.modifier);
    const showPressCount = useKeyStyle((state) => state.layout.showPressCount);

    const bgColor = event.isModifier() && modifier.highlight ? modifier.color : color.color;
    const textColor = event.isModifier() && modifier.highlight ? modifier.textColor : text.color;
    const borderColor = event.isModifier() && modifier.highlight ? modifier.borderColor : border.color;

    return (
        <div
            style={{
                position: "relative",
                height: text.size * 2.25,
                minWidth: text.size * (event.isModifier() ? 2.5 : 2.25),

                paddingInline: text.size * (border.radius < 0.75 ? 0.5 : (0.5 + border.radius - 0.75)),
                paddingBlock: text.size * 0.4,

                fontSize: text.size,
                color: textColor,

                borderRadius: border.radius * (text.size * 1.25),

                background: color.useGradient
                    ? `linear-gradient(oklch(from ${bgColor} clamp(0, calc(l + 0.1), 1) c h), ${bgColor})`
                    : bgColor,

                boxShadow: [
                    isPressed ? `inset 0 .05em .2em 0 ${darken(bgColor, 0.2)}` : `inset 0 .05em .1em 0 ${lighten(bgColor, 0.2)}`,
                    border.enabled && `0 0 0 ${border.width}px ${borderColor}`,
                    `0 .1em .1em 0 #00000080`,
                ].join(", "),

                transition: "box-shadow 0.1s ease",
            }}
        >
            {(showPressCount && lastest && event.pressedCount > 1) && <PressCount count={event.pressedCount} />}
            <KeycapBase event={event} />
        </div>
    );
};

================================================
FILE: src/components/keycaps/lowprofile.tsx
================================================
import { easeInOutExpo } from "@/lib/utils";
import { useKeyStyle } from "@/stores/key_style";
import { motion } from "motion/react";
import type { KeycapProps } from ".";
import { KeycapBase } from "./base";
import { PressCount } from "./press-count";

export const LowProfileKeycap = ({ event, isPressed, lastest }: KeycapProps) => {
    const color = useKeyStyle((state) => state.color);
    const text = useKeyStyle((state) => state.text);
    const border = useKeyStyle((state) => state.border);
    const modifier = useKeyStyle((state) => state.modifier);
    const showPressCount = useKeyStyle((state) => state.layout.showPressCount);

    const bgColor = event.isModifier() && modifier.highlight ? modifier.color : color.color;
    const secondaryColor = event.isModifier() && modifier.highlight ? modifier.secondaryColor : color.secondaryColor;
    const textColor = event.isModifier() && modifier.highlight ? modifier.textColor : text.color;
    const borderColor = event.isModifier() && modifier.highlight ? modifier.borderColor : border.color;

    return (
        <div
            style={{
                position: "relative",
                height: text.size * 2.5,
                minWidth: text.size * (event.isModifier() ? 2.5 : 2.25),
            }}
        >
            {(lastest && showPressCount && event.pressedCount > 1) && <PressCount count={event.pressedCount} />}
            <motion.div
                animate={{ y: isPressed ? text.size * 0.25 : 0 }}
                transition={{ ease: easeInOutExpo, duration: 0.1 }}
                style={{
                    zIndex: 2,
                    position: "relative",
                    height: text.size * 2.25,

                    paddingInline: text.size * (border.radius < 0.75 ? 0.5 : (0.5 + border.radius - 0.75)),
                    paddingBlock: text.size * 0.4,

                    fontSize: text.size,
                    color: textColor,

                    borderStyle: "solid",
                    borderWidth: border.enabled ? border.width : 0,
                    borderColor: borderColor,
                    borderRadius: border.radius * (text.size * 1.25),

                    background: bgColor,
                }}
            >
                <KeycapBase event={event} />
            </motion.div>
            <div
                style={{
                    position: "absolute",
                    height: text.size * 2.25,
                    width: "100%",
                    bottom: 0,
                    zIndex: 1,
                    borderStyle: "solid",
                    borderWidth: border.enabled ? border.width : 0,
                    borderColor: borderColor,
                    borderRadius: border.radius * (text.size * 1.25),

                    background: secondaryColor,
                }}
            />
        </div>
    );
};

================================================
FILE: src/components/keycaps/minimal.tsx
================================================
import { keymaps } from "@/lib/keymaps";
import { easeInOutExpo } from "@/lib/utils";
import { useKeyStyle } from "@/stores/key_style";
import { motion } from "motion/react";
import type { KeycapProps } from ".";

export const MinimalKeycap = ({ event, isPressed }: KeycapProps) => {
    const text = useKeyStyle((state) => state.text);
    const modifier = useKeyStyle((state) => state.modifier);
    const layout = useKeyStyle((state) => state.layout);

    const display = keymaps[event.name];
    const color = event.isModifier() && modifier.highlight ? modifier.textColor : text.color;
    const textStyle: React.CSSProperties = {
        color,
        lineHeight: 1.2,
        fontSize: text.size,
        textTransform: text.caps,
        gap: ".1em",
    };

    const label = display?.shortLabel ?? display.label;
    let child = <>{label}</>;

    if (event.isModifier() && layout.showIcon && display.icon) {
        const Icon = display.icon;
        if (text.variant === "icon" || event.isArrow()) {
            child = <Icon color={color} size={text.size} />;
        } else {
            child = <>
                <Icon color={color} size={text.size} />
                <div style={{ ...textStyle }}>
                    {text.variant === "text" ? display.label : label}
                </div>
            </>;
        }
    }

    return (
        <motion.div
            animate={{ scale: isPressed ? 0.95 : 1 }}
            transition={{ ease: easeInOutExpo, duration: 0.1 }}
            className="flex items-center h-full"
            style={textStyle}
        >
            {child}
        </motion.div>
    );
};

================================================
FILE: src/components/keycaps/pbt.tsx
================================================
import { darken, easeInOutExpo } from "@/lib/utils";
import { useKeyStyle } from "@/stores/key_style";
import { motion } from "motion/react";
import { KeycapProps } from ".";
import { KeycapBase } from "./base";
import { PressCount } from "./press-count";

export const PBTKeycap = ({ event, isPressed, lastest }: KeycapProps) => {
    const color = useKeyStyle((state) => state.color);
    const text = useKeyStyle((state) => state.text);
    const border = useKeyStyle((state) => state.border);
    const modifier = useKeyStyle((state) => state.modifier);
    const showPressCount = useKeyStyle((state) => state.layout.showPressCount);

    const bgColor = event.isModifier() && modifier.highlight ? modifier.color : color.color;
    const secondaryBgColor = event.isModifier() && modifier.highlight ? modifier.secondaryColor : color.secondaryColor;
    const textColor = event.isModifier() && modifier.highlight ? modifier.textColor : text.color;
    const borderColor = event.isModifier() && modifier.highlight ? modifier.borderColor : border.color;

    return (
        <div
            style={{
                position: "relative",
                height: text.size * 2.75,
                minWidth: text.size * (event.isModifier() ? 3 : 2.75),
                borderRadius: border.radius * (text.size * 1.25),
                background: color.useGradient
                    ? `linear-gradient(to bottom right, ${secondaryBgColor}, ${darken(secondaryBgColor, 0.2)})`
                    : secondaryBgColor,
                boxShadow: `0 0 0 ${border.enabled ? border.width : 0}px ${borderColor}`,
            }}
        >
            {(lastest && showPressCount && event.pressedCount > 1) && <PressCount count={event.pressedCount} />}
            <motion.div
                animate={{ y: isPressed ? text.size * 0.15 : 0 }}
                transition={{ ease: easeInOutExpo, duration: 0.1 }}
                style={{
                    height: text.size * 2.2,
                    minWidth: text.size * 2,

                    marginInline: text.size * 0.3,
                    paddingInline: text.size * (border.radius < 0.75 ? 0.5 : (0.5 + border.radius - 0.75)),
                    paddingBlock: text.size * 0.4,

                    fontSize: text.size,
                    color: textColor,

                    borderBottom: `.06em solid ${bgColor}`,
                    borderRadius: border.radius * (text.size * 1.25),

                    background: color.useGradient
                        ? `linear-gradient(to right, ${darken(bgColor, 0.1)}, ${bgColor})`
                        : bgColor,

                    boxShadow: color.useGradient ? '' : `0 0 0 ${border.enabled ? border.width : 0}px ${borderColor}`,
                }}
            >
                <KeycapBase event={event} />
            </motion.div>
        </div>
    );
}

================================================
FILE: src/components/keycaps/press-count.tsx
================================================
import { useKeyStyle } from "@/stores/key_style";
import { motion } from "motion/react";

// bug: clips when background enabled and border radius is greater than 50%
export const PressCount = ({ count }: { count: number }) => {
    const text = useKeyStyle((state) => state.text);
    const color = useKeyStyle(state => state.color.color);
    const borderRadius = useKeyStyle(state => state.border.radius);
    const appearance = useKeyStyle(state => state.appearance);

    const style = {
        width: text.size * 0.75,
        height: text.size * 0.75,
        color: color,
        backgroundColor: text.color,
        fontSize: text.size * 0.4,
        borderRadius: `${borderRadius * 100}%`,
    }

    if (appearance.animation === 'none') {
        return <div className="absolute z-10 top-0 right-0 flex items-center justify-center font-bold translate-x-1/4 -translate-y-1/4" style={style}>
            {count}
        </div>;
    }

    return (
        <motion.div
            className="absolute z-10 top-0 right-0 flex items-center justify-center font-bold translate-x-1/4 -translate-y-1/4"
            style={style}
            initial={{ scale: 0 }}
            animate={{ scale: 1 }}
            transition={{ duration: appearance.animationDuration / 2 }}
        >
            {count}
        </motion.div>
    );
};

================================================
FILE: src/components/mouse-indicator.tsx
================================================
import { useKeyEvent } from "@/stores/key_event";
import { useKeyStyle } from "@/stores/key_style";
import { JSX } from "react";


const mouseIcons: Record<string, JSX.Element> = {
    Default: (
        <svg className="w-full h-full" width="33" height="43" viewBox="0 0 33 43" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M16.5 9.5V1.5" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
            <path d="M16.5 41.5C28.5 41.5 31.5 32.48 31.5 21.5C31.5 10.52 28.5 1.5 16.5 1.5C4.49986 1.5 1.5 10.5199 1.5 21.5C1.5 32.48 4.49986 41.5 16.5 41.5Z" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
            <path d="M13.5 12.5C13.5 11.5681 13.5 11.1022 13.6522 10.7346C13.8552 10.2446 14.2446 9.85522 14.7346 9.65224C15.1022 9.5 15.5682 9.5 16.5 9.5C17.4318 9.5 17.8978 9.5 18.2654 9.65224C18.7554 9.85522 19.1448 10.2446 19.3478 10.7346C19.5 11.1022 19.5 11.5681 19.5 12.5V16.5C19.5 17.4319 19.5 17.8978 19.3478 18.2654C19.1448 18.7554 18.7554 19.1448 18.2654 19.3478C17.8978 19.5 17.4318 19.5 16.5 19.5C15.5682 19.5 15.1022 19.5 14.7346 19.3478C14.2446 19.1448 13.8552 18.7554 13.6522 18.2654C13.5 17.8978 13.5 17.4319 13.5 16.5V12.5Z" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
        </svg>

    ),
    Left: (
        <svg className="w-full h-full" width="37" height="43" viewBox="0 0 37 43" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M15.5 2.13688C16.9612 1.72134 18.6202 1.5 20.5 1.5C32.5 1.5 35.5 10.52 35.5 21.5C35.5 32.48 32.5 41.5 20.5 41.5C8.49986 41.5 5.5 32.48 5.5 21.5C5.5 20.4812 5.52582 19.4794 5.58226 18.5" stroke="white" stroke-width="3" stroke-linecap="round" />
            <path d="M6.5 13.5C9.26142 13.5 11.5 11.2614 11.5 8.5C11.5 5.73858 9.26142 3.5 6.5 3.5C3.73858 3.5 1.5 5.73858 1.5 8.5C1.5 11.2614 3.73858 13.5 6.5 13.5Z" stroke="#00FF6A" stroke-width="3" stroke-linecap="round" />
            <path d="M20.5 9.5V1.5" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
            <path d="M17.5 12.5C17.5 11.5681 17.5 11.1022 17.6522 10.7346C17.8552 10.2446 18.2446 9.85522 18.7346 9.65224C19.1022 9.5 19.5682 9.5 20.5 9.5C21.4318 9.5 21.8978 9.5 22.2654 9.65224C22.7554 9.85522 23.1448 10.2446 23.3478 10.7346C23.5 11.1022 23.5 11.5681 23.5 12.5V16.5C23.5 17.4319 23.5 17.8978 23.3478 18.2654C23.1448 18.7554 22.7554 19.1448 22.2654 19.3478C21.8978 19.5 21.4318 19.5 20.5 19.5C19.5682 19.5 19.1022 19.5 18.7346 19.3478C18.2446 19.1448 17.8552 18.7554 17.6522 18.2654C17.5 17.8978 17.5 17.4319 17.5 16.5V12.5Z" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
        </svg>
    ),
    Middle: (
        <svg className="w-full h-full" width="33" height="43" viewBox="0 0 33 43" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M16.5 9.5V1.5" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
            <path d="M16.5 41.5C28.5 41.5 31.5 32.48 31.5 21.5C31.5 10.52 28.5 1.5 16.5 1.5C4.49986 1.5 1.5 10.5199 1.5 21.5C1.5 32.48 4.49986 41.5 16.5 41.5Z" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
            <path d="M13.5 12.5C13.5 11.5681 13.5 11.1022 13.6522 10.7346C13.8552 10.2446 14.2446 9.85522 14.7346 9.65224C15.1022 9.5 15.5682 9.5 16.5 9.5C17.4318 9.5 17.8978 9.5 18.2654 9.65224C18.7554 9.85522 19.1448 10.2446 19.3478 10.7346C19.5 11.1022 19.5 11.5681 19.5 12.5V16.5C19.5 17.4319 19.5 17.8978 19.3478 18.2654C19.1448 18.7554 18.7554 19.1448 18.2654 19.3478C17.8978 19.5 17.4318 19.5 16.5 19.5C15.5682 19.5 15.1022 19.5 14.7346 19.3478C14.2446 19.1448 13.8552 18.7554 13.6522 18.2654C13.5 17.8978 13.5 17.4319 13.5 16.5V12.5Z" stroke="#00FF6A" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
        </svg>
    ),
    Right: (
        <svg className="w-full h-full" width="37" height="43" viewBox="0 0 37 43" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M21.5 2.13688C20.0388 1.72134 18.3798 1.5 16.5 1.5C4.5 1.5 1.5 10.52 1.5 21.5C1.5 32.48 4.5 41.5 16.5 41.5C28.5002 41.5 31.5 32.48 31.5 21.5C31.5 20.4812 31.4742 19.4794 31.4178 18.5" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
            <path d="M30.5 13.5C33.2614 13.5 35.5 11.2614 35.5 8.5C35.5 5.73858 33.2614 3.5 30.5 3.5C27.7386 3.5 25.5 5.73858 25.5 8.5C25.5 11.2614 27.7386 13.5 30.5 13.5Z" stroke="#00FF6A" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
            <path d="M16.5 9.5V1.5" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
            <path d="M13.5 12.5C13.5 11.5681 13.5 11.1022 13.6522 10.7346C13.8552 10.2446 14.2446 9.85522 14.7346 9.65224C15.1022 9.5 15.5682 9.5 16.5 9.5C17.4318 9.5 17.8978 9.5 18.2654 9.65224C18.7554 9.85522 19.1448 10.2446 19.3478 10.7346C19.5 11.1022 19.5 11.5681 19.5 12.5V16.5C19.5 17.4319 19.5 17.8978 19.3478 18.2654C19.1448 18.7554 18.7554 19.1448 18.2654 19.3478C17.8978 19.5 17.4318 19.5 16.5 19.5C15.5682 19.5 15.1022 19.5 14.7346 19.3478C14.2446 19.1448 13.8552 18.7554 13.6522 18.2654C13.5 17.8978 13.5 17.4319 13.5 16.5V12.5Z" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
        </svg>
    ),
    ScrollDown: (
        <svg className="w-full h-full" width="33" height="43" viewBox="0 0 33 43" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M16.5 41.5C28.5 41.5 31.5 32.48 31.5 21.5C31.5 10.52 28.5 1.5 16.5 1.5C4.49986 1.5 1.5 10.5199 1.5 21.5C1.5 32.48 4.49986 41.5 16.5 41.5Z" stroke="white" stroke-width="3" />
            <path d="M16.4766 11.1772V21.0173" stroke="#00FF6A" stroke-width="3" stroke-linecap="round" />
            <path d="M20.5082 19.7812C18.5402 21.8212 17.3402 23.6212 16.4282 23.4918C15.6602 23.4982 14.9402 22.3012 12.4922 19.7812" stroke="#00FF6A" stroke-width="3" stroke-linecap="round" />
        </svg>
    ),
    ScrollUp: (
        <svg className="w-full h-full" width="33" height="43" viewBox="0 0 33 43" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M16.5 41.5C28.5 41.5 31.5 32.48 31.5 21.5C31.5 10.52 28.5 1.5 16.5 1.5C4.49986 1.5 1.5 10.5199 1.5 21.5C1.5 32.48 4.49986 41.5 16.5 41.5Z" stroke="white" stroke-width="3" />
            <path d="M16.4766 11.1772V21.0173" stroke="#00FF6A" stroke-width="3" stroke-linecap="round" />
            <path d="M12.4922 13.2172C14.4602 11.1772 15.6602 9.37719 16.5722 9.50657C17.3402 9.50019 18.0602 10.6972 20.5082 13.2172" stroke="#00FF6A" stroke-width="3" stroke-linecap="round" />
        </svg>
    )
};
export const MouseIndicator = () => {
    const pressedButton = useKeyEvent(state => state.pressedMouseButton);
    const wheel = useKeyEvent(state => state.mouse.wheel);
    const style = useKeyStyle(state => state.mouse);

    let icon = "Default";

    if (pressedButton && mouseIcons[pressedButton]) {
        icon = pressedButton;
    } else if (wheel > 0) {
        icon = "ScrollUp";
    } else if (wheel < 0) {
        icon = "ScrollDown";
    }

    return (
        <div
            className="bg-black/50 text-white"
            style={{
                width: style.indicatorSize * 0.92,
                height: style.indicatorSize,
                marginTop: style.indicatorOffsetY,
                marginLeft: style.indicatorOffsetX,
                borderRadius: "45%",
                padding: style.indicatorSize * 0.2,
            }}
        >
            {mouseIcons[icon]}
        </div>
    );
}

================================================
FILE: src/components/mouse-overlay.tsx
================================================
import { easeInOutExpo } from "@/lib/utils";
import { useKeyEvent } from "@/stores/key_event";
import { useKeyStyle } from "@/stores/key_style";
import { motion } from "motion/react";
import { useEffect, useRef, useState } from "react";
import { MouseIndicator } from "./mouse-indicator";
import { platform } from "@tauri-apps/plugin-os";

const MIN_CLICK_DISPLAY_MS = 200;
const isMacos = platform() === "macos";

export const MouseOverlay = () => {
    const wheel = useKeyEvent(state => state.mouse.wheel);
    const pressedMouseButton = useKeyEvent(state => state.pressedMouseButton);
    const style = useKeyStyle(state => state.mouse);
    const animationDuration = useKeyStyle(state => state.appearance.animationDuration);

    const [show, setShow] = useState(false);

    const positionRef = useRef<HTMLDivElement>(null);
    const timeoutRef = useRef<NodeJS.Timeout | null>(null);
    const pressTimestampRef = useRef<number | null>(null);

    // Handle minimum display duration for mouse clicks
    useEffect(() => {
        if (pressedMouseButton) {
            // Mouse button pressed - show immediately and record timestamp
            setShow(true);
            pressTimestampRef.current = Date.now();
            // Clear any pending timeout
            if (timeoutRef.current) {
                clearTimeout(timeoutRef.current);
                timeoutRef.current = null;
            }
        } else if (show && pressTimestampRef.current) {
            // Mouse button released - check if minimum duration has passed
            const elapsed = Date.now() - pressTimestampRef.current;

            if (elapsed >= MIN_CLICK_DISPLAY_MS) {
                // Already displayed long enough - hide immediately
                setShow(false);
                pressTimestampRef.current = null;
            } else {
                // Need to maintain visibility for remaining time
                timeoutRef.current = setTimeout(() => {
                    setShow(false);
                    pressTimestampRef.current = null;
                    timeoutRef.current = null;
                }, MIN_CLICK_DISPLAY_MS - elapsed);
            }
        }

        return () => {
            if (timeoutRef.current) {
                clearTimeout(timeoutRef.current);
            }
        };
    }, [pressedMouseButton, show]);

    // Subscribe to mouse movement without re-rendering React
    useEffect(() => {
        if (!positionRef.current) return;

        // Zustand subscribe allows us to listen to changes without triggering a component re-render
        const unsubscribe = useKeyEvent.subscribe((state) => {
            const el = positionRef.current;
            if (!el) return;

            const shouldUpdatePosition =
                style.keepHighlight ||
                state.pressedMouseButton ||
                style.showIndicator ||
                style.keepIndicator;

            if (!shouldUpdatePosition) return;

            const dpr = isMacos ? 1 : window.devicePixelRatio || 1;
            el.style.transform =
                `translate3d(${state.mouse.x / dpr}px, ${state.mouse.y / dpr}px, 0) translate(-50%, -50%)`;
        });

        return () => unsubscribe();
    }, [style.showClicks, style.keepHighlight, style.showIndicator, style.keepIndicator]);

    // Logic to determine if we should render anything at all to keep DOM light
    const shouldRender = style.showClicks || style.keepHighlight || style.showIndicator || style.keepIndicator;
    if (!shouldRender) return null;


    return (
        <div className="absolute top-0 left-0 w-full h-full pointer-events-none overflow-hidden">
            <div
                ref={positionRef}
                className="absolute top-0 left-0 will-change-transform"
                style={{
                    width: style.size,
                    height: style.size,
                }}
            >
                {style.showClicks && (
                    <motion.div
                        className="w-full h-full"
                        initial={false}
                        animate={{
                            opacity: show || style.keepHighlight ? 1 : 0,
                            scale: show ? 0.5 : 1.0,
                            borderWidth: style.size / 20,
                        }}
                        style={{
                            borderColor: style.color,
                            borderStyle: "solid",
                            borderRadius: "50%",
                        }}
                        transition={{
                            duration: animationDuration,
                            ease: easeInOutExpo,
                        }}
                    />
                )}

                {style.showIndicator &&
                    <motion.div
                        className="absolute left-1/2 top-1/2"
                        animate={{ opacity: show || style.keepIndicator || wheel !== 0 ? 1 : 0 }}
                        transition={{ duration: 0.2 }}
                    >
                        <MouseIndicator />
                    </motion.div>
                }
            </div>
        </div>
    );
};

================================================
FILE: src/components/settings/about.tsx
================================================
import { Button } from "@/components/ui/button"
import { Item, ItemActions, ItemContent, ItemDescription, ItemTitle } from "@/components/ui/item"
import { DiscordIcon, GithubIcon, LinkSquare02Icon, SparklesIcon, StarsIcon } from "@hugeicons/core-free-icons"
import { HugeiconsIcon } from "@hugeicons/react"
import { openUrl } from "@tauri-apps/plugin-opener"
import { motion } from "motion/react"
import { useState } from "react"
import { toast } from "sonner"

export const VERSION = "2.1.0"

export const AboutPage = () => {
    const [checking, setChecking] = useState(false);
    const [updateAvailable, setUpdateAvailable] = useState(false);
    const [hovered, setHovered] = useState(false);

    const visitReleasePage = () => {
        openUrl('https://github.com/mulaRahul/keyviz/releases');
    }

    const checkForUpdates = async () => {
        setChecking(true);
        try {
            const response = await fetch('https://api.github.com/repos/mulaRahul/keyviz/releases/latest')
            const data = await response.json()
            const latestVersion = data.tag_name.substring(1, 6);
            if (latestVersion !== VERSION) {
                setUpdateAvailable(true);
                toast.success(
                    `New version available: v${latestVersion}`,
                    {
                        action: { label: 'View', onClick: visitReleasePage }
                    }
                );
            } else {
                toast.info("You are using the latest version.");
            }
        } catch (error) {
            toast.error("Failed to check for updates.");
        }
        setChecking(false);
    }

    return <div>
        <div className="py-6 flex flex-col items-center bg-linear-to-b from-secondary to-background">
            <div className="relative w-24 h-24">
                <motion.img
                    animate={{
                        scale: hovered ? 0.8 : 1,
                        opacity: hovered ? 0 : 1,
                    }}
                    className="absolute top-0 left-0 w-full h-full"
                    src="./logo.svg"
                    alt="logo"
                />
                <motion.img
                    initial={{ scale: 1.2, opacity: 0 }}
                    animate={{
                        scale: hovered ? 1 : 1.2,
                        opacity: hovered ? 1 : 0,
                        filter: hovered ? "" : ["hue-rotate(0deg)", "hue-rotate(360deg)"],
                        transition: {
                            delay: 0.1,
                            filter: {
                                repeat: Infinity,
                                duration: 4,
                                ease: "linear",
                            }
                        }
                    }}
                    className="absolute top-0 left-0 w-full h-full"
                    src="./logo-pro.svg"
                    alt="logo-pro"
                />
            </div>
            <h1 className="mt-4 mb-2 text-xl font-semibold">{
                hovered ? "Keyviz Pro" : "Keyviz"
            }</h1>
            <p className="text-center text-sm text-muted-foreground">
                v{VERSION}-beta <br />
                © 2026 Rahul Mula
            </p>
        </div>

        <div className="mt-6 px-6 flex flex-col gap-4">
            <motion.div
                animate={{
                    scale: hovered ? 1.02 : 1,
                    borderColor: hovered ? ["#FFCA94", "#B3FF88", "#00FFF5", "#B367FF", "#FFCA94"] : "transparent",
                }}
                transition={{
                    borderColor: {
                        repeat: Infinity,
                        duration: 4,
                        ease: "linear",
                    }
                }}
                onMouseEnter={() => setHovered(true)}
                onMouseLeave={() => setHovered(false)}
                className="peer border rounded-lg"
            >
                <Item
                    variant="muted"
                    className="hover:bg-muted"
                >
                    <ItemContent>
                        <ItemTitle>
                            <HugeiconsIcon icon={SparklesIcon} size="1em" /> Upgrade to Pro
                        </ItemTitle>
                        <ItemDescription>
                            Love Keyviz? Support its growth and unlock more with Pro.
                        </ItemDescription>
                    </ItemContent>
                    <ItemActions>
                        <Button
                            variant={hovered ? "default" : "outline"}
                            onClick={() => openUrl('https://keyviz.org/pro')}
                        >
                            Go Pro
                        </Button>
                    </ItemActions>
                </Item>
            </motion.div>

            <Item variant="muted" className="transition-all peer-hover:blur-xs">
                <ItemContent>
                    <ItemTitle>
                        <HugeiconsIcon icon={StarsIcon} size="1em" /> Check for updates
                    </ItemTitle>
                </ItemContent>
                <ItemActions>
                    {
                        updateAvailable
                            ? <Button className="cursor-pointer" onClick={visitReleasePage}>Update Available</Button>
                            : <Button variant="outline" onClick={checkForUpdates} disabled={checking}>Check</Button>
                    }
                </ItemActions>
            </Item>

            <Item variant="muted" className="transition-all peer-hover:blur-xs">
                <ItemContent>
                    <ItemTitle>
                        <HugeiconsIcon icon={GithubIcon} size="1em" /> Open Source
                    </ItemTitle>
                    <ItemDescription className="max-w-100">
                        Review the source code on GitHub, sponsor, star the project, or contribute to its development.
                    </ItemDescription>
                </ItemContent>
                <ItemActions>
                    <Button variant="outline" size="icon" onClick={() => openUrl('https://github.com/mulaRahul/keyviz')}>
                        <HugeiconsIcon icon={LinkSquare02Icon} />
                    </Button>
                </ItemActions>
            </Item>

            <Item variant="muted" className="transition-all peer-hover:blur-xs">
                <ItemContent>
                    <ItemTitle>
                        <HugeiconsIcon icon={DiscordIcon} size="1em" /> Discord
                    </ItemTitle>
                    <ItemDescription className="max-w-100">
                        Join our Discord community.
                    </ItemDescription>
                </ItemContent>
                <ItemActions>
                    <Button variant="outline" size="icon" onClick={() => openUrl('https://discord.gg/er9pddccyS')}>
                        <HugeiconsIcon icon={LinkSquare02Icon} />
                    </Button>
                </ItemActions>
            </Item>
        </div>
    </div>
}

================================================
FILE: src/components/settings/appearance.tsx
================================================
import { useEffect, useState } from "react";

import { AlignmentSelector } from "@/components/ui/alignment-selector";
import { Item, ItemActions, ItemContent, ItemDescription, ItemTitle } from "@/components/ui/item";
import { NumberInput } from "@/components/ui/number-input";
import { NumberScrubber } from "@/components/ui/number-input-scrub";
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Toggle } from "@/components/ui/toggle";
import { useKeyEvent } from "@/stores/key_event";
import { useKeyStyle } from "@/stores/key_style";
import { ComputerIcon, KeyframesDoubleIcon, KeyframesDoubleRemoveIcon, Link02Icon, ParagraphSpacingIcon, TextAlignLeftIcon, Time03Icon, Unlink02Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { availableMonitors, getAllWindows, Monitor } from "@tauri-apps/api/window";


export const AppearanceSettings = () => {
    const appearance = useKeyStyle(state => state.appearance);
    const setAppearance = useKeyStyle(state => state.setAppearance);

    const lingerDurationMs = useKeyEvent(state => state.lingerDurationMs);
    const setLingerDurationMs = useKeyEvent(state => state.setLingerDurationMs);

    const [marginLinked, setMarginLinked] = useState(appearance.marginX === appearance.marginY);
    const [monitors, setMonitors] = useState<Monitor[]>([]);

    useEffect(() => {
        availableMonitors().then(monitors => {
            if (!appearance.monitor && monitors.length > 1) {
                setAppearance({ monitor: monitors[0].name });
            }
            setMonitors(monitors);
        });
    }, []);

    return <div className="flex flex-col gap-y-4 p-6">
        <h1 className="text-xl font-semibold">Appearance</h1>

        <h2 className="text-sm text-muted-foreground font-medium">Position</h2>
        {
            monitors.length > 1 &&
            <Item variant="muted">
                <ItemContent>
                    <ItemTitle>
                        <HugeiconsIcon icon={ComputerIcon} size="1em" />
                        Display
                    </ItemTitle>
                    <ItemDescription>
                        Change monitor/display for the visualisation.
                    </ItemDescription>
                </ItemContent>
                <ItemActions>
                    <Select
                        value={appearance.monitor ?? ""}
                        onValueChange={(value) => {
                            getAllWindows().then(windows => {
                                const window = windows.find(w => w.label === "main");
                                const monitor = monitors.find(m => m.name === value);
                                if (monitor && window) {
                                    window.setPosition(monitor.position);
                                }
                            });
                            setAppearance({ monitor: value });
                        }}
                    >
                        <SelectTrigger className="w-32">
                            <SelectValue placeholder="Select Display" />
                        </SelectTrigger>
                        <SelectContent>
                            <SelectGroup>
                                {
                                    monitors.map((monitor, index) => (
                                        <SelectItem key={monitor.name} value={monitor.name ?? index.toString()}>
                                            {monitor.name ?? `Display ${index + 1}`} ({monitor.size.width}x{monitor.size.height})
                                        </SelectItem>
                                    ))
                                }
                            </SelectGroup>
                        </SelectContent>
                    </Select>
                </ItemActions>
            </Item>
        }

        <Item variant="muted">
            <ItemContent className="self-start">
                <ItemTitle>
                    <HugeiconsIcon icon={TextAlignLeftIcon} size="1em" /> Alignment
                </ItemTitle>
                <ItemDescription>
                    Position of the key visualization on the screen
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <AlignmentSelector
                    className="w-32 h-28 text-base"
                    value={appearance.alignment}
                    onChange={(value) => setAppearance({ alignment: value })}
                    disabledOptions={["center"]}
                />
            </ItemActions>
        </Item>

        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={ParagraphSpacingIcon} size="1em" /> Margin
                </ItemTitle>
                <ItemDescription>
                    Space from the edge of the screen
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <NumberScrubber
                    value={appearance.marginX}
                    onChange={marginLinked ? (marginX => { setAppearance({ marginX }); setAppearance({ marginY: marginX }); }) : (marginX => setAppearance({ marginX }))}
                    min={0}
                    max={200}
                    step={1}
                    icon={<span className="ml-0.5 text-xs font-medium">X</span>}
                    className="w-18"
                />
                <Toggle
                    variant="default"
                    pressed={marginLinked}
                    onPressedChange={(pressed) => {
                        setMarginLinked(pressed);
                        if (pressed) {
                            setAppearance({ marginY: appearance.marginX });
                        }
                    }}
                    aria-label="Margin linked"
                >
                    <HugeiconsIcon icon={marginLinked ? Link02Icon : Unlink02Icon} size="1em" />
                </Toggle>
                <NumberScrubber
                    value={appearance.marginY}
                    onChange={(marginY) => setAppearance({ marginY })}
                    min={0}
                    max={200}
                    step={1}
                    icon={<span className="ml-0.5 text-xs font-medium">Y</span>}
                    className="w-18"
                    disabled={marginLinked}
                />
            </ItemActions>
        </Item>

        <h2 className="text-sm text-muted-foreground font-medium">Animation</h2>
        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={Time03Icon} size="1em" /> Duration
                </ItemTitle>
                <ItemDescription className="max-w-84">
                    The duration keys stay on screen (in seconds)
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <NumberInput
                    value={lingerDurationMs / 1000}
                    onChange={(value) => setLingerDurationMs(value * 1000)}
                    step={0.2}
                    minValue={0}
                    className="w-32 h-8"
                />
            </ItemActions>
        </Item>

        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={KeyframesDoubleIcon} size="1em" /> Animation
                </ItemTitle>
            </ItemContent>
            <ItemActions>
                <Select value={appearance.animation} onValueChange={(value) => setAppearance({ animation: value as any })}>
                    <SelectTrigger className="w-32">
                        <SelectValue />
                    </SelectTrigger>
                    <SelectContent>
                        <SelectGroup>
                            <SelectItem value="none">None</SelectItem>
                            <SelectItem value="fade">Fade</SelectItem>
                            <SelectItem value="zoom">Zoom</SelectItem>
                            <SelectItem value="float">Float</SelectItem>
                            <SelectItem value="slide">Slide</SelectItem>
                        </SelectGroup>
                    </SelectContent>
                </Select>
            </ItemActions>
        </Item>

        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={KeyframesDoubleRemoveIcon} size="1em" /> Animation Speed
                </ItemTitle>
                <ItemDescription>
                    Higher the value, slower the animation
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <NumberInput
                    value={appearance.animationDuration}
                    onChange={(animationDuration) => setAppearance({ animationDuration })}
                    step={0.05}
                    minValue={0.05}
                    maxValue={1}
                    className="w-32 h-8"
                />
            </ItemActions>
        </Item>
    </div>;
}

================================================
FILE: src/components/settings/general.tsx
================================================
import { invoke } from '@tauri-apps/api/core';

import { ShortcutRecorder } from '@/components/shortcut-recorder';
import { Button } from '@/components/ui/button';
import {
    Drawer,
    DrawerContent,
    DrawerDescription,
    DrawerHeader,
    DrawerTitle,
    DrawerTrigger,
} from "@/components/ui/drawer";
import { Item, ItemActions, ItemContent, ItemDescription, ItemHeader, ItemTitle } from "@/components/ui/item";
import { NumberInput } from '@/components/ui/number-input';
import { Switch } from "@/components/ui/switch";
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group';
import { cn } from "@/lib/utils";
import { KeyEventState, useKeyEvent } from "@/stores/key_event";
import { KeyStyleState, useKeyStyle } from "@/stores/key_style";
import { ArrowHorizontalIcon, ArrowVerticalIcon, FilterHorizontalIcon, FilterIcon, LayerIcon, ToggleOnIcon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { CustomFilter } from '../custom-filter';


export const GeneralSettings = () => {
    const {
        filter, setFilter,
        allowedKeys,
        showEventHistory, setShowEventHistory,
        maxHistory, setMaxHistory,
        toggleShortcut, setToggleShortcut
    } = useKeyEvent();

    const direction = useKeyStyle(state => state.appearance.flexDirection);
    const setAppearance = useKeyStyle(state => state.setAppearance);

    return <div className="flex flex-col gap-y-4 p-6">
        <h1 className="text-xl font-semibold">General</h1>

        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={FilterIcon} size="1em" /> Filter
                </ItemTitle>
                <ItemDescription>
                    {filter === 'none' && 'No filter applied, all keys will be shown.'}
                    {filter === 'modifiers' && 'Only modifier keys will be shown.'}
                    {filter === 'custom' && `Custom filter applied, ${allowedKeys.length} keys allowed.`}
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                {
                    filter === 'custom' &&
                    <Drawer>
                        <DrawerTrigger asChild>
                            <Button variant="outline" size="icon-sm">
                                <HugeiconsIcon icon={FilterHorizontalIcon} />
                            </Button>
                        </DrawerTrigger>
                        <DrawerContent>
                            <DrawerContent>
                                <DrawerHeader>
                                    <DrawerTitle>Custom Filter</DrawerTitle>
                                    <DrawerDescription>Select which keys to display. Hold down Ctrl to toggle related keys.</DrawerDescription>
                                </DrawerHeader>
                                <CustomFilter />
                            </DrawerContent>
                        </DrawerContent>
                    </Drawer>
                }
                <ToggleGroup
                    size="sm"
                    type="single"
                    variant="outline"
                    value={filter}
                    onValueChange={(value) => setFilter(value as KeyEventState["filter"])}
                >
                    <ToggleGroupItem value="none" aria-label="No Filter">Off</ToggleGroupItem>
                    <ToggleGroupItem value="modifiers" aria-label="Modifiers Only">Hotkeys</ToggleGroupItem>
                    <ToggleGroupItem value="custom" aria-label="Custom Filter">Custom</ToggleGroupItem>
                </ToggleGroup>
            </ItemActions>
        </Item>

        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={LayerIcon} size="1em" /> History
                </ItemTitle>
                <ItemDescription>
                    Keep previously pressed keystrokes in the view
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <Switch checked={showEventHistory} onCheckedChange={setShowEventHistory} />
            </ItemActions>
        </Item>

        <div className={cn("flex flex-col gap-4 md:flex-row", showEventHistory ? "" : "pointer-events-none opacity-50", "transition-opacity")}>
            <Item variant="muted" className="flex-7">
                <ItemContent>
                    <ItemTitle>Direction</ItemTitle>
                </ItemContent>
                <ItemActions>
                    <ToggleGroup
                        size="sm"
                        type="single"
                        variant="outline"
                        value={direction}
                        onValueChange={(value) => setAppearance({ flexDirection: value as KeyStyleState["appearance"]["flexDirection"] })}
                    >
                        <ToggleGroupItem value="row" aria-label="Horizontal">
                            <HugeiconsIcon icon={ArrowHorizontalIcon} strokeWidth={2} size={10} /> Row
                        </ToggleGroupItem>
                        <ToggleGroupItem value="column" aria-label="Vertical">
                            <HugeiconsIcon icon={ArrowVerticalIcon} strokeWidth={2} /> Column
                        </ToggleGroupItem>
                    </ToggleGroup>
                </ItemActions>
            </Item>
            <Item variant="muted" className="flex-5">
                <ItemContent>
                    <ItemTitle>Max Count</ItemTitle>
                </ItemContent>
                <ItemActions className="max-w-20">
                    <NumberInput className="h-8" value={maxHistory} onChange={setMaxHistory} minValue={2} maxValue={12} />
                </ItemActions>
            </Item>
        </div>

        <Item variant="muted">
            <ItemHeader className="flex-col items-start">
                <ItemTitle>
                    <HugeiconsIcon icon={ToggleOnIcon} size="1em" /> Toggle Shortcut
                </ItemTitle>
                <ItemDescription>
                    Global shortcut to show/hide the key visualizer, click box to set
                </ItemDescription>
            </ItemHeader>
            <ItemContent>
                <ShortcutRecorder value={toggleShortcut} onChange={shortcut => {
                    setToggleShortcut(shortcut);
                    invoke('set_toggle_shortcut', { shortcut });
                }} />
            </ItemContent>
        </Item>
    </div>;
}

================================================
FILE: src/components/settings/index.tsx
================================================
export { GeneralSettings } from "./general";
export { AppearanceSettings } from "./appearance";
export { KeycapSettings } from "./keycap";
export { MouseSettings } from "./mouse";
export { AboutPage } from "./about";

================================================
FILE: src/components/settings/keycap.tsx
================================================
import { AlignmentSelector } from "@/components/ui/alignment-selector";
import { Button } from "@/components/ui/button";
import { ColorInput } from "@/components/ui/color-picker";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGrid, ItemGroup, ItemTitle } from "@/components/ui/item";
import { Label } from "@/components/ui/label";
import { NumberInput } from "@/components/ui/number-input";
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Slider } from "@/components/ui/slider";
import { Switch } from "@/components/ui/switch";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { KeyStyleState, useKeyStyle } from "@/stores/key_style";
import { AlignHorizontalCenterIcon, AlignLeftIcon, AlignRightIcon, Download01Icon, PaintBoardIcon, Refresh01Icon, Upload01Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuTrigger } from "../ui/dropdown-menu";
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible";

export interface KeycapTheme {
    name: string;
    primary: string;
    secondary: string;
    text: string;
}

export const colorSchemes: KeycapTheme[] = [
    {
        name: "Silver",
        primary: "#f8f8f8",
        secondary: "#dcdcdc",
        text: "#000000",
    },
    {
        name: "Stone",
        primary: "#606060",
        secondary: "#4b4b4b",
        text: "#f8f8f8",
    },
    {
        name: "Lime",
        primary: "#606060",
        secondary: "#4b4b4b",
        text: "#D6ED17",
    },
    {
        name: "Cyber",
        primary: "#00B1D2",
        secondary: "#008ea8",
        text: "#FDDB27",
    },
    {
        name: "Turquoise",
        primary: "#42EADD",
        secondary: "#2ec4b8",
        text: "#ffffff",
    },
    {
        name: "Blue",
        primary: "#2196f3",
        secondary: "#1976d2",
        text: "#ffffff",
    },
    {
        name: "Yellow",
        primary: "#FDDB27",
        secondary: "#dfc019",
        text: "#000000",
    },
    {
        name: "Green",
        primary: "#66bb6a",
        secondary: "#43a047",
        text: "#ffffff",
    },
    {
        name: "Pink",
        primary: "#f06292",
        secondary: "#d81b60",
        text: "#ffffff",
    },
    {
        name: "Red",
        primary: "#ef5350",
        secondary: "#c62828",
        text: "#ffffff",
    },
    {
        name: "Pansy",
        primary: "#673ab7",
        secondary: "#4527a0",
        text: "#ffc107",
    },
    {
        name: "Eclipse",
        primary: "#343148",
        secondary: "#252333",
        text: "#D7C49E",
    },
    {
        name: "Bumblebee",
        primary: "#404040",
        secondary: "#2e2e2e",
        text: "#FDDB27",
    },
    {
        name: "Charcoal",
        primary: "#404040",
        secondary: "#2e2e2e",
        text: "#FFFFFF",
    },
];

export const KeycapSettings = () => {
    const appearance = useKeyStyle(state => state.appearance);
    const setAppearance = useKeyStyle(state => state.setAppearance);

    const text = useKeyStyle(state => state.text);
    const setTextStyle = useKeyStyle(state => state.setText);

    const layout = useKeyStyle(state => state.layout);
    const setLayoutStyle = useKeyStyle(state => state.setLayout);

    const modifier = useKeyStyle(state => state.modifier);
    const setModifierStyle = useKeyStyle(state => state.setModifier);

    const color = useKeyStyle(state => state.color);
    const setColorStyle = useKeyStyle(state => state.setColor);

    const border = useKeyStyle(state => state.border);
    const setBorderStyle = useKeyStyle(state => state.setBorder);

    const background = useKeyStyle(state => state.background);
    const setBackgroundStyle = useKeyStyle(state => state.setBackground);

    const importStyle = useKeyStyle(state => state.import);
    const exportStyle = useKeyStyle(state => state.export);

    const onStyleChange = (value: string) => {
        if (value === "minimal") {
            setTextStyle({ variant: "icon" });
            setModifierStyle({ highlight: false });
            setLayoutStyle({ showIcon: true });
        }
        setAppearance({ style: value as KeyStyleState["appearance"]["style"] });
    }

    const randomizeStyle = () => {
        const scheme = colorSchemes[Math.floor(Math.random() * colorSchemes.length)];
        setLayoutStyle({
            showIcon: Math.random() > 0.5,
            showSymbol: Math.random() > 0.5,
        });
        setColorStyle({
            color: scheme.primary,
            secondaryColor: scheme.secondary,
            useGradient: Math.random() > 0.5,
        });
        setBorderStyle({ color: scheme.secondary, radius: Math.random() });
        setTextStyle({ color: scheme.text });
        if (modifier.highlight) {
            const modScheme = colorSchemes[Math.floor(Math.random() * colorSchemes.length)];
            setModifierStyle({
                color: modScheme.primary,
                secondaryColor: modScheme.secondary,
                borderColor: modScheme.secondary,
                textColor: modScheme.text,
            });
        } else if (background.enabled) {
            setBackgroundStyle({ color: scheme.text });
        }
    }

    return <div className="flex flex-col p-6 gap-y-4">
        <h1 className="text-xl font-semibold">Keycap</h1>

        <h2 className="text-sm text-muted-foreground font-medium">Preset</h2>
        <Item variant="muted">
            <ItemActions className="w-full">
                <Select value={appearance.style} onValueChange={onStyleChange}>
                    <SelectTrigger className="w-28">
                        <SelectValue />
                    </SelectTrigger>
                    <SelectContent>
                        <SelectGroup>
                            <SelectItem value="minimal">Minimal</SelectItem>
                            <SelectItem value="laptop">Laptop</SelectItem>
                            <SelectItem value="lowprofile">Lowprofile</SelectItem>
                            <SelectItem value="pbt" >PBT</SelectItem>
                        </SelectGroup>
                    </SelectContent>
                </Select>
                <DropdownMenu>
                    <DropdownMenuTrigger asChild>
                        <Button variant="outline" size="icon">
                            <HugeiconsIcon icon={PaintBoardIcon} />
                        </Button>
                    </DropdownMenuTrigger>
                    <DropdownMenuContent>
                        <DropdownMenuGroup>
                            {
                                colorSchemes.map((scheme) => (
                                    <DropdownMenuItem key={scheme.name} onClick={() => {
                                        setColorStyle({ color: scheme.primary, secondaryColor: scheme.secondary });
                                        setBorderStyle({ color: scheme.secondary });
                                        setTextStyle({ color: scheme.text });
                                    }
                                    }>
                                        <div
                                            className="w-4 h-4 flex justify-center items-center mr-1 text-center text-xs border border-muted-foreground/20 rounded-xs"
                                            style={{ backgroundColor: scheme.primary, color: scheme.text }}
                                        >
                                            A</div>
                                        {scheme.name}
                                    </DropdownMenuItem>
                                ))
                            }
                        </DropdownMenuGroup>
                    </DropdownMenuContent>
                </DropdownMenu>
                <Button variant="ghost" size="icon" onClick={randomizeStyle} className="active:rotate-90">
                    <HugeiconsIcon icon={Refresh01Icon} />
                </Button>

                <Button variant="outline" size="sm" className="ml-auto" onClick={importStyle}>
                    <HugeiconsIcon icon={Download01Icon} className="mr-2" /> Import
                </Button>
                <Button variant="outline" size="sm" onClick={exportStyle}>
                    <HugeiconsIcon icon={Upload01Icon} className="mr-2" /> Export
                </Button>
            </ItemActions>
        </Item>

        <Collapsible defaultOpen={true}>
            <CollapsibleTrigger>
                <h2 className="text-sm text-muted-foreground font-medium">Text</h2>
            </CollapsibleTrigger>
            <CollapsibleContent className="flex flex-col gap-y-4 pt-4">
                <ItemGrid className="md:grid-cols-[240px_1fr]">
                    <AlignmentSelector
                        value={text.alignment}
                        onChange={(value) => setTextStyle({ alignment: value })}
                        className="w-full h-48 text-2xl"
                    />
                    <ItemGroup>
                        <Item variant="muted" className="flex-2">
                            <ItemContent>
                                <ItemTitle>Size</ItemTitle>
                            </ItemContent>
                            <ItemActions>
                                <NumberInput
                                    value={text.size}
                                    onChange={(value) => setTextStyle({ size: value })} minValue={8}
                                    className="w-28 h-8"
                                />
                            </ItemActions>
                        </Item>
                        <Item variant="muted" className="flex-2">
                            <ItemContent>
                                <ItemTitle>Variant</ItemTitle>
                            </ItemContent>
                            <ItemActions>
                                <Select value={text.variant} onValueChange={(value) => {
                                    setTextStyle({ variant: value as KeyStyleState["text"]["variant"] });
                                    if (value === "icon") {
                                        setLayoutStyle({ showIcon: true });
                                    }
                                }}>
                                    <SelectTrigger className="w-28">
                                        <SelectValue placeholder="text variant" />
                                    </SelectTrigger>
                                    <SelectContent>
                                        <SelectItem value="text">Full Text</SelectItem>
                                        <SelectItem value="text-short">Short Text</SelectItem>
                                        <SelectItem value="icon">Icon Only</SelectItem>
                                    </SelectContent>
                                </Select>

                            </ItemActions>
                        </Item>
                        <Item variant="muted" className="flex-2">
                            <ItemContent>
                                <ItemTitle>Text Cap</ItemTitle>
                            </ItemContent>
                            <ItemActions>
                                <ToggleGroup
                                    type="single"
                                    value={text.caps} onValueChange={(value) => setTextStyle({ caps: value as KeyStyleState["text"]["caps"] })}
                                    variant="outline"
                                    className="w-28"
                                >
                                    <ToggleGroupItem className="w-1/3" value="uppercase">AA</ToggleGroupItem>
                                    <ToggleGroupItem className="w-1/3" value="capitalize">Aa</ToggleGroupItem>
                                    <ToggleGroupItem className="w-1/3" value="lowercase">aa</ToggleGroupItem>
                                </ToggleGroup>
                            </ItemActions>
                        </Item>
                    </ItemGroup>
                </ItemGrid>
                <ItemGrid>
                    <Item variant="muted" className={modifier.highlight ? "" : "col-span-2"}>
                        <ItemContent>
                            <ItemTitle>Text Color</ItemTitle>
                        </ItemContent>
                        <ItemActions>
                            <ColorInput value={text.color} onChange={(color) => setTextStyle({ color })} />
                        </ItemActions>
                    </Item>
                    {
                        modifier.highlight &&
                        <Item variant="muted">
                            <ItemContent>
                                <ItemTitle>Modifier Color</ItemTitle>
                            </ItemContent>
                            <ItemActions>
                                <ColorInput value={modifier.textColor} onChange={(textColor) => setModifierStyle({ textColor })} />
                            </ItemActions>
                        </Item>
                    }
                </ItemGrid>
            </CollapsibleContent>
        </Collapsible>

        <Collapsible>
            <CollapsibleTrigger>
                <h2 className="text-sm text-muted-foreground font-medium">Layout</h2>
            </CollapsibleTrigger>
            <CollapsibleContent className="flex flex-col gap-y-4 pt-4">
                <ItemGrid>
                    <Item variant="muted">
                        <ItemContent>
                            <ItemTitle>Icon</ItemTitle>
                        </ItemContent>
                        <ItemActions>
                            <Switch
                                checked={layout.showIcon}
                                onCheckedChange={(showIcon) => setLayoutStyle({ showIcon })}
                                disabled={text.variant === "icon"}
                            />
                        </ItemActions>
                    </Item>
                    <Item variant="muted">
                        <ItemContent>
                            <ItemTitle>Alignment</ItemTitle>
                        </ItemContent>
                        <ItemActions>
                            <ToggleGroup
                                type="single"
                                value={layout.iconAlignment}
                                onValueChange={(value) => setLayoutStyle({ iconAlignment: value as KeyStyleState["layout"]["iconAlignment"] })}
                                variant="outline"
                                className="w-28"
                                disabled={!layout.showIcon}
                            >
                                <ToggleGroupItem className="w-1/3" value="flex-start">
                                    <HugeiconsIcon icon={AlignLeftIcon} />
                                </ToggleGroupItem>
                                <ToggleGroupItem className="w-1/3" value="center">
                                    <HugeiconsIcon icon={AlignHorizontalCenterIcon} />
                                </ToggleGroupItem>
                                <ToggleGroupItem className="w-1/3" value="flex-end">
                                    <HugeiconsIcon icon={AlignRightIcon} />
                                </ToggleGroupItem>
                            </ToggleGroup>
                        </ItemActions>
                    </Item>
                </ItemGrid>
                <Item variant="muted">
                    <ItemContent>
                        <ItemTitle>Symbol</ItemTitle>
                        <ItemDescription>Display symbol characters like !, @, #, etc.</ItemDescription>
                    </ItemContent>
                    <ItemActions>
                        <Switch
                            checked={layout.showSymbol}
                            onCheckedChange={(showSymbol) => setLayoutStyle({ showSymbol })}
                        />
                    </ItemActions>
                </Item>
                {
                    appearance.style !== "minimal" &&
                    <Item variant="muted">
                        <ItemContent>
                            <ItemTitle>Press Count</ItemTitle>
                            <ItemDescription>Display the number of times a key has been pressed.</ItemDescription>
                        </ItemContent>
                        <ItemActions>
                            <Switch
                                checked={layout.showPressCount}
                                onCheckedChange={(showPressCount) => setLayoutStyle({ showPressCount })}
                            />
                        </ItemActions>
                    </Item>
                }
            </CollapsibleContent>
        </Collapsible>

        {
            appearance.style !== "minimal" &&
            <Collapsible>
                <CollapsibleTrigger>
                    <h2 className="text-sm text-muted-foreground font-medium">Color</h2>
                </CollapsibleTrigger>
                <CollapsibleContent className="flex flex-col gap-y-4 pt-4">
                    <Item variant="muted">
                        <ItemContent>
                            <ItemTitle>Highlight Modifier</ItemTitle>
                            <ItemDescription>Use different color for modifier keys</ItemDescription>
                        </ItemContent>
                        <ItemActions>
                            <Switch checked={modifier.highlight} onCheckedChange={(highlight) => setModifierStyle({ highlight })} />
                        </ItemActions>
                    </Item>
                    {
                        appearance.style !== "lowprofile" &&
                        <Item variant="muted">
                            <ItemContent>
                                <ItemTitle>Gradient</ItemTitle>
                            </ItemContent>
                            <ItemActions>
                                <Switch
                                    checked={color.useGradient}
                                    onCheckedChange={(useGradient) => setColorStyle({ useGradient })}
                                />
                            </ItemActions>
                        </Item>
                    }
                    {
                        (appearance.style === "laptop") ?
                            <ItemGrid>
                                <Item variant="muted" className={modifier.highlight ? "" : "col-span-2"}>
                                    <ItemContent>
                                        <ItemTitle>Normal</ItemTitle>
                                    </ItemContent>
                                    <ItemActions>
                                        <ColorInput value={color.color} onChange={(color) => setColorStyle({ color })} />
                                    </ItemActions>
                                </Item>
                                {
                                    modifier.highlight &&
                                    <Item variant="muted">
                                        <ItemContent>
                                            <ItemTitle>Modifier</ItemTitle>
                                        </ItemContent>
                                        <ItemActions>
                                            <ColorInput value={modifier.color} onChange={(color) => setModifierStyle({ color })} />
                                        </ItemActions>
                                    </Item>
                                }
                            </ItemGrid> :
                            <>
                                {modifier.highlight && <h1>Normal Color</h1>}
                                <ItemGrid>
                                    <Item variant="muted">
                                        <ItemContent>
                                            <ItemTitle>Primary</ItemTitle>
                                        </ItemContent>
                                        <ItemActions>
                                            <ColorInput
                                                value={color.color}
                                                onChange={(color) => setColorStyle({ color })}
                                            />
                                        </ItemActions>
                                    </Item>
                                    <Item variant="muted">
                                        <ItemContent>
                                            <ItemTitle>Secondary</ItemTitle>
                                        </ItemContent>
                                        <ItemActions>
                                            <ColorInput
                                                value={color.secondaryColor}
                                                onChange={(secondaryColor) => setColorStyle({ secondaryColor })}
                                            />
                                        </ItemActions>
                                    </Item>
                                </ItemGrid>
                                {
                                    modifier.highlight && <>
                                        <h1>Modifier Color</h1>
                                        <ItemGrid>
                                            <Item variant="muted">
                                                <ItemContent>
                                                    <ItemTitle>Primary</ItemTitle>
                                                </ItemContent>
                                                <ItemActions>
                                                    <ColorInput
                                                        value={modifier.color}
                                                        onChange={(color) => setModifierStyle({ color })}
                                                    />
                                                </ItemActions>
                                            </Item>
                                            <Item variant="muted">
                                                <ItemContent>
                                                    <ItemTitle>Secondary</ItemTitle>
                                                </ItemContent>
                                                <ItemActions>
                                                    <ColorInput
                                                        value={modifier.secondaryColor}
                                                        onChange={(secondaryColor) => setModifierStyle({ secondaryColor })}
                                                    />
                                                </ItemActions>
                                            </Item>
                                        </ItemGrid>
                                    </>
                                }
                            </>
                    }
                </CollapsibleContent>
            </Collapsible>
        }

        <Collapsible>
            <CollapsibleTrigger>
                <h2 className="text-sm text-muted-foreground font-medium">Border</h2>
            </CollapsibleTrigger>
            <CollapsibleContent className="flex flex-col gap-y-4 pt-4">
                <ItemGrid>
                    <Item variant="muted">
                        <ItemContent className="min-h-6 h-full justify-center">
                            <ItemTitle>Enable</ItemTitle>
                        </ItemContent>
                        <ItemActions>
                            <Switch id="borderEnabled" checked={border.enabled} onCheckedChange={(enabled) => setBorderStyle({ enabled })} />
                        </ItemActions>
                    </Item>
                    <Item variant="muted">
                        <ItemContent>
                            <ItemTitle>Width</ItemTitle>
                        </ItemContent>
                        <ItemActions>
                            <NumberInput
                                minValue={0.5}
                                step={0.5}
                                value={border.width}
                                onChange={(width) => setBorderStyle({ width })}
                                className="max-w-20 h-8"
                                isDisabled={!border.enabled}
                            />
                        </ItemActions>
                    </Item>
                    <Item variant="muted" className={modifier.highlight ? "" : "col-span-2"}>
                        <ItemContent>
                            <ItemTitle>Color</ItemTitle>
                        </ItemContent>
                        <ItemActions>
                            <ColorInput
                                value={border.color}
                                onChange={(color) => setBorderStyle({ color })}
                                disabled={!border.enabled}
                            />
                        </ItemActions>
                    </Item>
                    {
                        modifier.highlight && <Item variant="muted">
                            <ItemContent>
                                <ItemTitle>Modifier Color</ItemTitle>
                            </ItemContent>
                            <ItemActions>
                                <ColorInput
                                    value={modifier.borderColor}
                                    onChange={(color) => setModifierStyle({ borderColor: color })}
                                    disabled={!border.enabled}
                                />
                            </ItemActions>
                        </Item>
                    }
                </ItemGrid>
                <Item variant="muted">
                    <ItemContent>
                        <ItemTitle>Radius</ItemTitle>
                    </ItemContent>
                    <ItemActions>
                        <div className="w-4 h-4 border-l-2 border-t-2 border-primary/50" style={{ borderTopLeftRadius: `${border.radius * 100}%` }} />
                        <Slider
                            min={0}
                            max={1}
                            step={0.01}
                            value={[border.radius]}
                            onValueChange={(value) => setBorderStyle({ radius: value[0] })}
                            className="w-40 h-8 mx-2"
                        />
                        <Label htmlFor="borderRadius" className="w-[4ch] font-mono text-right">{(border.radius * 100).toFixed(0)}%</Label>
                    </ItemActions>
                </Item>
            </CollapsibleContent>
        </Collapsible>

        <Collapsible>
            <CollapsibleTrigger>
                <h2 className="text-sm text-muted-foreground font-medium">Background</h2>
            </CollapsibleTrigger>
            <CollapsibleContent className="flex flex-col gap-y-4 pt-4">
                <ItemGrid>
                    <Item variant="muted">
                        <ItemContent className="min-h-6 h-full justify-center">
                            <ItemTitle>Enable</ItemTitle>
                        </ItemContent>
                        <ItemActions>
                            <Switch checked={background.enabled} onCheckedChange={(enabled) => setBackgroundStyle({ enabled })} />
                        </ItemActions>
                    </Item>
                    <Item variant="muted">
                        <ItemContent>
                            <ItemTitle>Color</ItemTitle>
                        </ItemContent>
                        <ItemActions>
                            <ColorInput value={background.color} onChange={(color) => setBackgroundStyle({ color })} disabled={!background.enabled} />
                        </ItemActions>
                    </Item>
                </ItemGrid>
            </CollapsibleContent>
        </Collapsible>
    </div>;
}

================================================
FILE: src/components/settings/mouse.tsx
================================================
import { ColorInput } from "@/components/ui/color-picker";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGrid, ItemTitle } from "@/components/ui/item";
import { NumberInput } from "@/components/ui/number-input";
import { Switch } from "@/components/ui/switch";
import { useKeyEvent } from "@/stores/key_event";
import { useKeyStyle } from '@/stores/key_style';
import { ArrowExpand02Icon, Cursor01Icon, CursorCircleSelection01Icon, CursorEdit01Icon, CursorMagicSelection03FreeIcons, Drag03Icon, KeyboardIcon, Link02Icon, MouseLeftClick05Icon, PaintBoardIcon, Unlink02Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { NumberScrubber } from "../ui/number-input-scrub";
import { useState } from "react";
import { Toggle } from "../ui/toggle";


export const MouseSettings = () => {
    const mouse = useKeyStyle(state => state.mouse);
    const setMouseStyle = useKeyStyle(state => state.setMouse);

    const dragThreshold = useKeyEvent(state => state.dragThreshold);
    const setDragThreshold = useKeyEvent(state => state.setDragThreshold);

    const [offsetLinked, setOffsetLinked] = useState(true);

    return <div className="flex flex-col gap-y-4 p-6">
        <h1 className="text-xl font-semibold">Mouse</h1>

        <h2 className="text-sm text-muted-foreground font-medium">Cursor Highlight</h2>
        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={CursorMagicSelection03FreeIcons} size="1em" /> Show Clicks
                </ItemTitle>
                <ItemDescription>
                    Animate a ring upon mouse press
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <Switch
                    checked={mouse.showClicks}
                    onCheckedChange={(showClicks) => setMouseStyle({ showClicks })}
                />
            </ItemActions>
        </Item>

        <ItemGrid>
            <Item variant="muted">
                <ItemContent>
                    <ItemTitle>
                        <HugeiconsIcon icon={CursorCircleSelection01Icon} size="1em" /> Size
                    </ItemTitle>
                </ItemContent>
                <ItemActions>
                    <NumberInput
                        step={10}
                        className="w-32 h-8"
                        value={mouse.size}
                        onChange={(size) => setMouseStyle({ size })}
                    />
                </ItemActions>
            </Item>

            <Item variant="muted">
                <ItemContent>
                    <ItemTitle>
                        <HugeiconsIcon icon={PaintBoardIcon} size="1em" /> Color
                    </ItemTitle>
                </ItemContent>
                <ItemActions>
                    <ColorInput
                        className="w-32"
                        value={mouse.color}
                        onChange={(color) => setMouseStyle({ color })}
                        disabled={!mouse.showClicks}
                    />
                </ItemActions>
            </Item>
        </ItemGrid>

        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={Cursor01Icon} size="1em" /> Always Highlight
                </ItemTitle>
                <ItemDescription>
                    Permanently show the ring around the cursor
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <Switch
                    checked={mouse.keepHighlight}
                    onCheckedChange={(keepHighlight) => setMouseStyle({ keepHighlight })}
                    disabled={!mouse.showClicks}
                />
            </ItemActions>
        </Item>

        <h2 className="text-sm text-muted-foreground font-medium mt-2">Button Indicator</h2>
        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={MouseLeftClick05Icon} size="1em" /> Show Indicator
                </ItemTitle>
                <ItemDescription>
                    Display button and scroll icons next to the cursor
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <Switch
                    checked={mouse.showIndicator}
                    onCheckedChange={(showIndicator) => setMouseStyle({ showIndicator })}
                />
            </ItemActions>
        </Item>

        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={Cursor01Icon} size="1em" /> Keep Indicator
                </ItemTitle>
                <ItemDescription>
                    Permanently show the icon beside the cursor
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <Switch
                    checked={mouse.keepIndicator}
                    onCheckedChange={(keepIndicator) => setMouseStyle({ keepIndicator })}
                    disabled={!mouse.showIndicator}
                />
            </ItemActions>
        </Item>

        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={CursorEdit01Icon} size="1em" /> Size
                </ItemTitle>
            </ItemContent>
            <ItemActions>
                <NumberInput
                    className="w-32 h-8"
                    value={mouse.indicatorSize}
                    onChange={(indicatorSize) => setMouseStyle({ indicatorSize })}
                />
            </ItemActions>
        </Item>

        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={ArrowExpand02Icon} size="1em" /> Offset
                </ItemTitle>
                <ItemDescription>
                    Space from the cursor to the indicator
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <NumberScrubber
                    value={mouse.indicatorOffsetX}
                    onChange={offsetLinked ? (indicatorOffsetX => { setMouseStyle({ indicatorOffsetX }); setMouseStyle({ indicatorOffsetY: indicatorOffsetX }); }) : (indicatorOffsetX => setMouseStyle({ indicatorOffsetX }))}
                    step={1}
                    icon={<span className="ml-0.5 text-xs font-medium">X</span>}
                    className="w-18"
                />
                <Toggle
                    variant="default"
                    pressed={offsetLinked}
                    onPressedChange={(pressed) => {
                        setOffsetLinked(pressed);
                        if (pressed) {
                            setMouseStyle({ indicatorOffsetY: mouse.indicatorOffsetX });
                        }
                    }}
                    aria-label="Offset linked"
                >
                    <HugeiconsIcon icon={offsetLinked ? Link02Icon : Unlink02Icon} size="1em" />
                </Toggle>
                <NumberScrubber
                    value={mouse.indicatorOffsetY}
                    onChange={(indicatorOffsetY) => setMouseStyle({ indicatorOffsetY })}
                    step={1}
                    icon={<span className="ml-0.5 text-xs font-medium">Y</span>}
                    className="w-18"
                    disabled={offsetLinked}
                />
            </ItemActions>
        </Item>

        <h2 className="text-sm text-muted-foreground font-medium mt-2">Event</h2>
        <Item variant="muted">
            <ItemContent>
                <ItemTitle>
                    <HugeiconsIcon icon={Drag03Icon} size="1em" /> Drag Threshold
                </ItemTitle>
                <ItemDescription>
                    Minimum distance in pixels to show Drag event
                </ItemDescription>
            </ItemContent>
            <ItemActions>
                <NumberInput
                    className="w-32 h-8"
                    value={dragThreshold}
                    onChange={setDragThreshold}
                />
            </ItemActions>
        </Item>
    </div>;
}

================================================
FILE: src/components/shortcut-recorder.tsx
================================================
import { keymaps } from '@/lib/keymaps';
import { RawKey } from '@/types/event';
import { useEffect, useRef, useState } from 'react';


// --- Types ---
interface ShortcutInputProps {
  value: string[]; // Array of keys, e.g. ['Shift', 'F10']
  onChange: (keys: string[]) => void;
  placeholder?: string;
}

const punctuationMap: { [key: string]: string } = {
  "`": "BackQuote",
  "-": "Minus",
  "=": "Equal",
  "[": "LeftBracket",
  "]": "RightBracket",
  "\\": "BackSlash",
  ";": "SemiColon",
  "'": "Quote",
  ",": "Comma",
  ".": "Dot",
  "/": "Slash",
};

// --- Helper: Format keys into RawKey ---
const formatKey = (key: string) => {
  // Alphabetic keys
  if (key.length === 1 && key.match(/[a-zA-Z]/)) {
    return `Key${key.toUpperCase()}`;
  }
  // Numeric keys
  else if (key.length === 1 && key.match(/[0-9]/)) {
    return `Num${key}`;
  }
  // Arrow keys
  else if (key.startsWith("Arrow")) {
    return `${key.replace("Arrow", "")}Arrow`;
  }
  // Punctuation keys
  else if (punctuationMap[key]) {
    return punctuationMap[key];
  }
  return key;
};

const ShortcutRecorder: React.FC<ShortcutInputProps> = ({
  value,
  onChange,
  placeholder = "Click to set shortcut"
}) => {
  const [isRecording, setIsRecording] = useState(false);
  const inputRef = useRef<HTMLDivElement>(null);

  // --- Logic: Handle Key Down ---
  useEffect(() => {
    if (!isRecording) return;

    const handleKeyDown = (e: KeyboardEvent) => {
      e.preventDefault();
      e.stopPropagation();

      const { key, ctrlKey, altKey, shiftKey, metaKey, repeat } = e;
      if (repeat) return;

      // 1. Handle Cancel (Escape)
      if (key === 'Escape') {
        setIsRecording(false);
        inputRef.current?.blur();
        return;
      }

      // 2. Handle Clear (Backspace/Delete)
      if (key === 'Backspace' || key === 'Delete') {
        onChange([]);
        setIsRecording(false);
        return;
      }

      // 3. Identify Modifiers
      const modifiers = [];
      if (ctrlKey) modifiers.push(RawKey.ControlLeft);
      if (shiftKey) modifiers.push(RawKey.ShiftLeft);
      if (altKey) modifiers.push(RawKey.Alt);
      if (metaKey) modifiers.push(RawKey.MetaLeft);

      // 4. Identify the main key
      if (['Control', 'Shift', 'Alt', 'Meta'].includes(key)) {
        // If user is just holding modifiers, we don't set the value yet,
        // but typically UI waits for a non-modifier key.
        // For this simple implementation, we assume we wait for a non-modifier.
        return;
      }

      // 5. Construct final combo
      const finalKey = formatKey(key);
      const newShortcut = [...new Set([...modifiers, finalKey])]; // Set removes duplicates

      onChange(newShortcut);
      setIsRecording(false);
      inputRef.current?.blur();
    };

    // Attach to window to ensure we catch everything while recording
    window.addEventListener('keydown', handleKeyDown);
    window.addEventListener('click', handleClickOutside);

    return () => {
      window.removeEventListener('keydown', handleKeyDown);
      window.removeEventListener('click', handleClickOutside);
    };
  }, [isRecording, onChange]);

  // Stop recording if user clicks elsewhere
  const handleClickOutside = (e: MouseEvent) => {
    if (inputRef.current && !inputRef.current.contains(e.target as Node)) {
      setIsRecording(false);
    }
  };

  return (
    <div className="flex flex-col items-start gap-2">
      <div
        ref={inputRef}
        onClick={() => setIsRecording(true)}
        className={`
          relative flex items-center w-full h-14 p-2 bg-background rounded-lg outline cursor-pointer transition-all
          ${isRecording
            ? 'outline-primary'
            : 'outline-transparent hover:outline-primary/50'
          }
        `}
        tabIndex={0} // Make div focusable
      >
        {isRecording ? (
          <span className="text-primary font-medium ml-2">
            Press your combination. Esc to cancel.
          </span>
        ) : (
          <div className="flex gap-2">
            {value.length > 0 ? (
              value.map(k => <KeyCap key={k} label={keymaps[k]?.label ?? k} />)
            ) : (
              <span className="text-gray-400 select-none">{placeholder}</span>
            )}
          </div>
        )}
      </div>
    </div>
  );
};

const KeyCap = ({ label }: { label: string }) => {
  return (
    <div className="h-9 bg-linear-to-b from-primary/50 to-secondary rounded-lg">
      <div className="m-px mb-0.5 px-3 py-1.5 bg-secondary rounded-lg capitalize">
        {label}
      </div>
    </div>
  );
}

export { ShortcutRecorder };



================================================
FILE: src/components/theme-mode-toggle.tsx
================================================
import { useTheme } from "@/components/theme-provider"
import { Button } from "@/components/ui/button"
import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
import { Moon02Icon, Sun01Icon } from "@hugeicons/core-free-icons"
import { HugeiconsIcon } from "@hugeicons/react"

export function ThemeModeToggle() {
  const { setTheme } = useTheme()

  return (
    <DropdownMenu>
      <DropdownMenuTrigger asChild>
        <Button variant="ghost" size="icon">
          <HugeiconsIcon icon={Sun01Icon} className="h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" />
          <HugeiconsIcon icon={Moon02Icon} className="absolute h-[1.2rem] w-[1.2rem] text-muted-foreground scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" />
          <span className="sr-only">Toggle theme</span>
        </Button>
      </DropdownMenuTrigger>
      <DropdownMenuContent align="start">
        <DropdownMenuItem onClick={() => setTheme("light")}>
          Light
        </DropdownMenuItem>
        <DropdownMenuItem onClick={() => setTheme("dark")}>
          Dark
        </DropdownMenuItem>
        <DropdownMenuItem onClick={() => setTheme("system")}>
          System
        </DropdownMenuItem>
      </DropdownMenuContent>
    </DropdownMenu>
  )
}

================================================
FILE: src/components/theme-provider.tsx
================================================
import { createContext, useContext, useEffect, useState } from "react"

type Theme = "dark" | "light" | "system"

type ThemeProviderProps = {
  children: React.ReactNode
  defaultTheme?: Theme
  storageKey?: string
}

type ThemeProviderState = {
  theme: Theme
  setTheme: (theme: Theme) => void
}

const initialState: ThemeProviderState = {
  theme: "system",
  setTheme: () => null,
}

const ThemeProviderContext = createContext<ThemeProviderState>(initialState)

export function ThemeProvider({
  children,
  defaultTheme = "system",
  storageKey = "vite-ui-theme",
  ...props
}: ThemeProviderProps) {
  const [theme, setTheme] = useState<Theme>(
    () => (localStorage.getItem(storageKey) as Theme) || defaultTheme
  )

  useEffect(() => {
    const root = window.document.documentElement

    root.classList.remove("light", "dark")

    if (theme === "system") {
      const systemTheme = window.matchMedia("(prefers-color-scheme: dark)")
        .matches
        ? "dark"
        : "light"

      root.classList.add(systemTheme)
      return
    }

    root.classList.add(theme)
  }, [theme])

  const value = {
    theme,
    setTheme: (theme: Theme) => {
      localStorage.setItem(storageKey, theme)
      setTheme(theme)
    },
  }

  return (
    <ThemeProviderContext.Provider {...props} value={value}>
      {children}
    </ThemeProviderContext.Provider>
  )
}

export const useTheme = () => {
  const context = useContext(ThemeProviderContext)

  if (context === undefined)
    throw new Error("useTheme must be used within a ThemeProvider")

  return context
}

================================================
FILE: src/components/ui/alert-dialog.tsx
================================================
import * as React from "react"
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog"

import { cn } from "@/lib/utils"
import { Button } from "@/components/ui/button"

function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
  return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
}

function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
  return (
    <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
  )
}

function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
  return (
    <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
  )
}

function AlertDialogOverlay({
  className,
  ...props
}: AlertDialogPrimitive.Backdrop.Props) {
  return (
    <AlertDialogPrimitive.Backdrop
      data-slot="alert-dialog-overlay"
      className={cn(
        "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",
        className
      )}
      {...props}
    />
  )
}

function AlertDialogContent({
  className,
  size = "default",
  ...props
}: AlertDialogPrimitive.Popup.Props & {
  size?: "default" | "sm"
}) {
  return (
    <AlertDialogPortal>
      <AlertDialogOverlay />
      <AlertDialogPrimitive.Popup
        data-slot="alert-dialog-content"
        data-size={size}
        className={cn(
          "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",
          className
        )}
        {...props}
      />
    </AlertDialogPortal>
  )
}

function AlertDialogHeader({
  className,
  ...props
}: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="alert-dialog-header"
      className={cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className)}
      {...props}
    />
  )
}

function AlertDialogFooter({
  className,
  ...props
}: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="alert-dialog-footer"
      className={cn(
        "bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
        className
      )}
      {...props}
    />
  )
}

function AlertDialogMedia({
  className,
  ...props
}: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="alert-dialog-media"
      className={cn("bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", className)}
      {...props}
    />
  )
}

function AlertDialogTitle({
  className,
  ...props
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
  return (
    <AlertDialogPrimitive.Title
      data-slot="alert-dialog-title"
      className={cn("text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className)}
      {...props}
    />
  )
}

function AlertDialogDescription({
  className,
  ...props
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
  return (
    <AlertDialogPrimitive.Description
      data-slot="alert-dialog-description"
      className={cn("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3", className)}
      {...props}
    />
  )
}

function AlertDialogAction({
  className,
  ...props
}: React.ComponentProps<typeof Button>) {
  return (
    <Button
      data-slot="alert-dialog-action"
      className={cn(className)}
      {...props}
    />
  )
}

function AlertDialogCancel({
  className,
  variant = "outline",
  size = "default",
  ...props
}: AlertDialogPrimitive.Close.Props &
  Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
  return (
    <AlertDialogPrimitive.Close
      data-slot="alert-dialog-cancel"
      className={cn(className)}
      render={<Button variant={variant} size={size} />}
      {...props}
    />
  )
}

export {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogMedia,
  AlertDialogOverlay,
  AlertDialogPortal,
  AlertDialogTitle,
  AlertDialogTrigger,
}


================================================
FILE: src/components/ui/alignment-selector.tsx
================================================
import { cn } from "@/lib/utils";
import { Alignment } from "@/types/style";
import { ArrowDown02Icon, ArrowDownLeftIcon, ArrowDownRightIcon, ArrowLeft02Icon, ArrowRight02Icon, ArrowUp02Icon, ArrowUpLeftIcon, ArrowUpRightIcon, PlusSignIcon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";


interface AlignmentSelectorProps {
    value: Alignment;
    onChange: (value: Alignment) => void;
    className?: string;
    disabledOptions?: Alignment[];
    iconStrokeWidth?: number;
}

const AlignmentSelector: React.FC<AlignmentSelectorProps> = ({ value, onChange, className, disabledOptions = [], iconStrokeWidth = 2 }) => {

    const items = [
        { value: 'top-left' as Alignment, icon: ArrowUpLeftIcon, },
        { value: 'top-center' as Alignment, icon: ArrowUp02Icon, },
        { value: 'top-right' as Alignment, icon: ArrowUpRightIcon, },
        { value: 'center-left' as Alignment, icon: ArrowLeft02Icon, },
        { value: 'center' as Alignment, icon: PlusSignIcon, },
        { value: 'center-right' as Alignment, icon: ArrowRight02Icon, },
        { value: 'bottom-left' as Alignment, icon: ArrowDownLeftIcon, },
        { value: 'bottom-center' as Alignment, icon: ArrowDown02Icon, },
        { value: 'bottom-right' as Alignment, icon: ArrowDownRightIcon, }
    ]

    return (
        <div className={cn("p-2 bg-background border border-primary/20 rounded-xl w-fit", className)}>
            <div className="w-full h-full grid grid-cols-3 grid-rows-3 gap-2">
                {items.map(({ value: pos, icon }) => {
                    const isSelected = value === pos;
                    return (
                        disabledOptions?.includes(pos) ? <div key={pos}/> :
                            <button
                                key={pos}
                                onClick={() => onChange(pos)}
                                title={pos.replace('-', ' ')} // Tooltip on hover
                                aria-label={`Align ${pos}`}
                                aria-pressed={isSelected}
                                className={`
                  relative rounded-md transition-all duration-200 ease-in-out
                  ${isSelected
                                        ? "bg-primary/10 scale-105"  // Active State
                                        : "hover:bg-primary/25" // Inactive State
                                    }
                `}
                            >
                                {isSelected
                                    ? <HugeiconsIcon icon={icon} size="1em" strokeWidth={iconStrokeWidth ?? 2} className="m-auto text-primary" />
                                    : <span className="absolute inset-0 m-auto w-1 h-1 bg-secondary rounded-full opacity-80" />
                                }
                            </button>
                    );
                })}
            </div>
        </div>
    );
};

export { AlignmentSelector };



================================================
FILE: src/components/ui/badge.tsx
================================================
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/lib/utils"

const badgeVariants = cva(
  "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
        secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
        destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",
        outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
        ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
        link: "text-primary underline-offset-4 hover:underline",
      },
    },
    defaultVariants: {
      variant: "default",
    },
  }
)

function Badge({
  className,
  variant = "default",
  render,
  ...props
}: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
  return useRender({
    defaultTagName: "span",
    props: mergeProps<"span">(
      {
        className: cn(badgeVariants({ className, variant })),
      },
      props
    ),
    render,
    state: {
      slot: "badge",
      variant,
    },
  })
}

export { Badge, badgeVariants }


================================================
FILE: src/components/ui/button-group.tsx
================================================
import { mergeProps } from "@base-ui/react/merge-props"
import { useRender } from "@base-ui/react/use-render"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/lib/utils"
import { Separator } from "@/components/ui/separator"

const buttonGroupVariants = cva(
  "has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
  {
    variants: {
      orientation: {
        horizontal:
          "[&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0 [&>[data-slot]]:rounded-r-none",
        vertical:
          "[&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! flex-col [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0 [&>[data-slot]]:rounded-b-none",
      },
    },
    defaultVariants: {
      orientation: "horizontal",
    },
  }
)

function ButtonGroup({
  className,
  orientation,
  ...props
}: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
  return (
    <div
      role="group"
      data-slot="button-group"
      data-orientation={orientation}
      className={cn(buttonGroupVariants({ orientation }), className)}
      {...props}
    />
  )
}

function ButtonGroupText({
  className,
  render,
  ...props
}: useRender.ComponentProps<"div">) {
  return useRender({
    defaultTagName: "div",
    props: mergeProps<"div">(
      {
        className: cn(
          "bg-muted gap-2 rounded-lg border px-2.5 text-sm font-medium [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none",
          className
        ),
      },
      props
    ),
    render,
    state: {
      slot: "button-group-text",
    },
  })
}

function ButtonGroupSeparator({
  className,
  orientation = "vertical",
  ...props
}: React.ComponentProps<typeof Separator>) {
  return (
    <Separator
      data-slot="button-group-separator"
      orientation={orientation}
      className={cn(
        "bg-input relative self-stretch data-[orientation=horizontal]:mx-px data-[orientation=horizontal]:w-auto data-[orientation=vertical]:my-px data-[orientation=vertical]:h-auto",
        className
      )}
      {...props}
    />
  )
}

export {
  ButtonGroup,
  ButtonGroupSeparator,
  ButtonGroupText,
  buttonGroupVariants,
}


================================================
FILE: src/components/ui/button.tsx
================================================
import { Button as ButtonPrimitive } from "@base-ui/react/button"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/lib/utils"

const buttonVariants = cva(
  "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
        outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",
        secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
        ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
        destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
        link: "text-primary underline-offset-4 hover:underline",
      },
      size: {
        default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
        xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
        sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
        lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
        icon: "size-8",
        "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
        "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
        "icon-lg": "size-9",
      },
    },
    defaultVariants: {
      variant: "default",
      size: "default",
    },
  }
)

function Button({
  className,
  variant = "default",
  size = "default",
  ...props
}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
  return (
    <ButtonPrimitive
      data-slot="button"
      className={cn(buttonVariants({ variant, size, className }))}
      {...props}
    />
  )
}

export { Button, buttonVariants }


================================================
FILE: src/components/ui/card.tsx
================================================
import * as React from "react"

import { cn } from "@/lib/utils"

function Card({
  className,
  size = "default",
  ...props
}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
  return (
    <div
      data-slot="card"
      data-size={size}
      className={cn("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-xl py-4 text-sm ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col", className)}
      {...props}
    />
  )
}

function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-header"
      className={cn(
        "gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",
        className
      )}
      {...props}
    />
  )
}

function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-title"
      className={cn("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className)}
      {...props}
    />
  )
}

function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-description"
      className={cn("text-muted-foreground text-sm", className)}
      {...props}
    />
  )
}

function CardAction({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-action"
      className={cn(
        "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
        className
      )}
      {...props}
    />
  )
}

function CardContent({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-content"
      className={cn("px-4 group-data-[size=sm]/card:px-3", className)}
      {...props}
    />
  )
}

function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-footer"
      className={cn("bg-muted/50 rounded-b-xl border-t p-4 group-data-[size=sm]/card:p-3 flex items-center", className)}
      {...props}
    />
  )
}

export {
  Card,
  CardHeader,
  CardFooter,
  CardTitle,
  CardAction,
  CardDescription,
  CardContent,
}


================================================
FILE: src/components/ui/collapsible.tsx
================================================
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible"

function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
  return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
}

function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
  return (
    <CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
  )
}

function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {
  return (
    <CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
  )
}

export { Collapsible, CollapsibleTrigger, CollapsibleContent }


================================================
FILE: src/components/ui/color-picker.tsx
================================================
'use client';

import { colord, extend } from 'colord';
import namesPlugin from 'colord/plugins/names';
import { PipetteIcon } from 'lucide-react';
import { Slider } from 'radix-ui';
import {
  type ComponentProps,
  createContext,
  type HTMLAttributes,
  memo,
  useCallback,
  useContext,
  useEffect,
  useMemo,
  useRef,
  useState,
} from 'react';

import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from '@/components/ui/select';
import { cn } from '@/lib/utils';
import { Popover, PopoverContent, PopoverTrigger } from './popover';

// Enable CSS color names (e.g., "red")
extend([namesPlugin]);

// --- Context ---

interface ColorPickerContextValue {
  hue: number;
  saturation: number;
  lightness: number;
  alpha: number;
  mode: string;
  setHue: (hue: number) => void;
  setSaturation: (saturation: number) => void;
  setLightness: (lightness: number) => void;
  setAlpha: (alpha: number) => void;
  setMode: (mode: string) => void;
}

const ColorPickerContext = createContext<ColorPickerContextValue | undefined>(
  undefined
);

export const useColorPicker = () => {
  const context = useContext(ColorPickerContext);
  if (!context) {
    throw new Error('useColorPicker must be used within a ColorPickerProvider');
  }
  return context;
};

// --- Main Component ---

export type ColorPickerProps = HTMLAttributes<HTMLDivElement> & {
  value?: string; // Hex, rgba, etc.
  defaultValue?: string;
  onChange?: (value: string) => void; // #RRGGBBAA
};

export const ColorPicker = ({
  value,
  defaultValue = '#000000',
  onChange,
  className,
  ...props
}: ColorPickerProps) => {
  // Initialize state from value or defaultValue
  const initialColor = useMemo(() => {
    return colord(value || defaultValue).toHsl();
  }, [value, defaultValue]);

  const [hue, setHue] = useState(initialColor.h);
  const [saturation, setSaturation] = useState(initialColor.s);
  const [lightness, setLightness] = useState(initialColor.l);
  const [alpha, setAlpha] = useState(initialColor.a * 100);
  const [mode, setMode] = useState('hex');

  // Sync state if external value prop changes
  useEffect(() => {
    if (value) {
      // Don't update internal state if the incoming value is effectively the same
      // as what we already have.
      const currentColor = colord({ h: hue, s: saturation, l: lightness, a: alpha / 100 });
      if (currentColor.isEqual(value)) return;

      const newColor = colord(value).toHsl();
      setHue(newColor.h);
      setSaturation(newColor.s);
      setLightness(newColor.l);
      setAlpha(newColor.a * 100);
    }
  }, [value]);

  // Notify parent of changes
  useEffect(() => {
    if (onChange) {
      const color = colord({ h: hue, s: saturation, l: lightness, a: alpha / 100 });
      const newHex = color.toHex();
      // Only fire onChange if the new color is different from the prop passed in.
      if (value && colord(value).isEqual(newHex)) {
        return;
      }
      // toHex() automatically handles alpha:
      // - Returns #RRGGBB if alpha is 100%
      // - Returns #RRGGBBAA if alpha is < 100%
      onChange(newHex);
    }
  }, [hue, saturation, lightness, alpha, onChange]);

  return (
    <ColorPickerContext.Provider
      value={{
        hue,
        saturation,
        lightness,
        alpha,
        mode,
        setHue,
        setSaturation,
        setLightness,
        setAlpha,
        setMode,
      }}
    >
      <div
        className={cn('flex w-full flex-col gap-4', className)}
        {...props}
      />
    </ColorPickerContext.Provider>
  );
};

// --- Sub Components ---

export const ColorPickerSelection = memo(
  ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => {
    const containerRef = useRef<HTMLDivElement>(null);
    const [isDragging, setIsDragging] = useState(false);
    const { hue, saturation, lightness, setSaturation, setLightness } = useColorPicker();

    // 1. Determine Thumb Position
    // We must convert the current HSL state to HSV to correctly position the thumb
    // on this specific visual gradient (which is an HSV gradient).
    const { s: hsvS, v: hsvV } = useMemo(() => {
      return colord({ h: hue, s: saturation, l: lightness }).toHsv();
    }, [hue, saturation, lightness]);

    // 2. Background Gradient (Standard HSV Picker)
    // Bottom: Black, Right: White -> Transparent, Base: Hue
    const backgroundGradient = useMemo(() => {
      return `
        linear-gradient(to top, #000 0%, transparent 100%), 
        linear-gradient(to right, #fff 0%, transparent 100%), 
        hsl(${hue}, 100%, 50%)
      `;
    }, [hue]);

    const updateColorFromInteraction = useCallback(
      (clientX: number, clientY: number) => {
        if (!containerRef.current) return;
        const rect = containerRef.current.getBoundingClientRect();

        // 3. Get Mouse Position (0 to 1)
        const x = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width));
        const y = Math.max(0, Math.min(1, (clientY - rect.top) / rect.height));

        // 4. Convert Mouse(HSV) -> State(HSL)
        // X is HSV Saturation (0-100)
        // Y is HSV Value (100-0) (Inverted because top is bright)
        const newHsvS = x * 100;
        const newHsvV = (1 - y) * 100;

        // We use colord to convert HSV -> HSL safely
        const newColor = colord({ h: hue, s: newHsvS, v: newHsvV });
        const { s, l } = newColor.toHsl();

        setSaturation(s);
        setLightness(l);
      },
      [hue, setSaturation, setLightness]
    );

    const handlePointerMove = useCallback(
      (event: PointerEvent) => {
        updateColorFromInteraction(event.clientX, event.clientY);
      },
      [updateColorFromInteraction]
    );

    const handlePointerDown = (e: React.PointerEvent) => {
      e.preventDefault(); // Prevent text selection
      setIsDragging(true);
      updateColorFromInteraction(e.clientX, e.clientY);
    };

    useEffect(() => {
      const handleUp = () => setIsDragging(false);
      const handleMove = (e: PointerEvent) => {
        if (isDragging) handlePointerMove(e);
      };

      if (isDragging) {
        window.addEventListener('pointermove', handleMove);
        window.addEventListener('pointerup', handleUp);
      }
      return () => {
        window.removeEventListener('pointermove', handleMove);
        window.removeEventListener('pointerup', handleUp);
      };
    }, [isDragging, handlePointerMove]);

    return (
      <div
        ref={containerRef}
        className={cn('relative h-40 w-full cursor-crosshair rounded-md shadow-sm', className)}
        style={{ background: backgroundGradient }}
        onPointerDown={handlePointerDown}
        {...props}
      >
        <div
          className="pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-sm ring-1 ring-black/10"
          style={{
            // Position based on HSV values, not HSL state
            left: `${hsvS}%`,
            top: `${100 - hsvV}%`,
          }}
        />
      </div>
    );
  }
);
ColorPickerSelection.displayName = 'ColorPickerSelection';

export const ColorPickerHue = ({ className, ...props }: ComponentProps<typeof Slider.Root>) => {
  const { hue, setHue } = useColorPicker();

  return (
    <Slider.Root
      className={cn('relative flex h-4 w-full touch-none select-none items-center', className)}
      value={[hue]}
      max={360}
      step={1}
      onValueChange={([val]) => setHue(val)}
      {...props}
    >
      <Slider.Track className="relative h-3 w-full grow rounded-full bg-[linear-gradient(to_right,red,yellow,lime,cyan,blue,magenta,red)]">
        <Slider.Range className="absolute h-full rounded-full" />
      </Slider.Track>
      <Slider.Thumb className="block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" />
    </Slider.Root>
  );
};

export const ColorPickerAlpha = ({ className, ...props }: ComponentProps<typeof Slider.Root>) => {
  const { alpha, setAlpha, hue, saturation, lightness } = useColorPicker();

  // Create a gradient that fades from transparent to the current color
  const colorHex = colord({ h: hue, s: saturation, l: lightness }).toHex();

  return (
    <Slider.Root
      className={cn('relative flex h-4 w-full touch-none select-none items-center', className)}
      value={[alpha]}
      max={100}
      step={1}
      onValueChange={([val]) => setAlpha(val)}
      {...props}
    >
      {/* Checkerboard background for alpha indication */}
      <Slider.Track className="relative h-3 w-full grow overflow-hidden rounded-full border border-black/5 bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIi8+CjxyZWN0IHdpZHRoPSI0IiBoZWlnaHQ9IjQiIGZpbGw9IiNjY2MiLz4KPHJlY3QgeD0iNCIgeT0iNCIgd2lkdGg9IjQiIGhlaWdodD0iNCIgZmlsbD0iI2NjYyIvPgo8L3N2Zz4=')]">
        {/* Gradient overlay */}
        <div
          className="absolute inset-0 h-full w-full"
          style={{ background: `linear-gradient(to right, transparent, ${colorHex})` }}
        />
        <Slider.Range className="absolute h-full" />
      </Slider.Track>
      <Slider.Thumb className="block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" />
    </Slider.Root>
  );
};

export const ColorPickerEyeDropper = ({ className, ...props }: ComponentProps<typeof Button>) => {
  const { setHue, setSaturation, setLightness, setAlpha } = useColorPicker();

  // Safe check for browser support
  const isSupported = typeof window !== 'undefined' && 'EyeDropper' in window;

  const handleEyeDropper = async () => {
    if (!isSupported) return;

    try {
      // @ts-expect-error - EyeDropper API is experimental
      const eyeDropper = new EyeDropper();
      const result = await eyeDropper.open();
      const color = colord(result.sRGBHex);
      const { h, s, l, a } = color.toHsl();

      setHue(h);
      setSaturation(s);
      setLightness(l);
      setAlpha(a * 100);
    } catch (error) {
      console.error('EyeDropper cancelled or failed:', error);
    }
  };

  if (!isSupported) return null;

  return (
    <Button
      variant="outline"
      size="icon"
      className={cn('shrink-0', className)}
      onClick={handleEyeDropper}
      {...props}
    >
      <PipetteIcon className="h-4 w-4" />
    </Button>
  );
};

// --- Inputs Area ---

export const ColorPickerOutput = ({ className, ...props }: ComponentProps<typeof SelectTrigger>) => {
  const { mode, setMode } = useColorPicker();
  const formats = ['hex', 'rgb', 'hsl', 'css'];

  return (
    <Select value={mode} onValueChange={setMode}>
      <SelectTrigger className={cn('h-8 w-18 px-2 text-xs', className)} {...props}>
        <SelectValue placeholder="Mode" />
      </SelectTrigger>
      <SelectContent>
        {formats.map((f) => (
          <SelectItem key={f} value={f} className="text-xs uppercase">
            {f}
          </SelectItem>
        ))}
      </SelectContent>
    </Select>
  );
};

// Helper for Number Inputs
const ChannelInput = ({
  value,
  onChange,
  max = 255,
  label,
  className
}: {
  value: number;
  onChange: (val: number) => void;
  max?: number;
  label?: string;
  className?: string;
}) => {
  return (
    <div className={cn("relative flex items-center", className)}>
      <Input
        value={value}
        onChange={(e) => {
          const val = parseInt(e.target.value);
          if (!isNaN(val)) {
            onChange(Math.max(0, Math.min(max, val)));
          }
        }}
        className="h-8 px-2 pr-2 text-xs"
      />
      {label && <span className="absolute right-2 text-[10px] text-muted-foreground pointer-events-none">{label}</span>}
    </div>
  );
};

export const ColorPickerFormat = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => {
  const { hue, saturation, lightness, alpha, mode, setHue, setSaturation, setLightness, setAlpha } = useColorPicker();

  const color = colord({ h: hue, s: saturation, l: lightness, a: alpha / 100 });

  // -- Handlers for direct input changes --

  const handleHexChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    const val = e.target.value;
    const newColor = colord(val);
    if (newColor.isValid()) {
      const { h, s, l, a } = newColor.toHsl();
      setHue(h);
      setSaturation(s);
      setLightness(l);
      // Only update alpha if the hex actually included it (length check or comparison)
      // Standard hex is 6 or 7 chars. 8 or 9 includes alpha.
      if (val.length > 7) setAlpha(a * 100);
    }
  };

  // Render logic based on mode
  if (mode === 'hex') {
    return (
      <div className={cn('flex gap-2', className)} {...props}>
        <div className="relative flex-1">
          <Input
            defaultValue={color.toHex()} // Use defaultValue to allow typing freely
            onBlur={handleHexChange}    // Validate on blur
            key={color.toHex()}         // Force re-render if external state changes
            className="h-8 px-2 text-xs"
          />
          <span className="absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground pointer-events-none">HEX</span>
        </div>
        <ChannelInput
          value={Math.round(alpha)}
          onChange={setAlpha}
          max={100}
          label="%"
          className="w-14"
        />
      </div>
    );
  }

  if (mode === 'rgb') {
    const { r, g, b } = color.toRgb();
    return (
      <div className={cn('flex gap-1', className)} {...props}>
        <ChannelInput value={r} onChange={(val) => {
          const { h, s, l } = colord({ r: val, g, b }).toHsl();
          setHue(h); setSaturation(s); setLightness(l);
        }} label="R" className="flex-1" />
        <ChannelInput value={g} onChange={(val) => {
          const { h, s, l } = colord({ r, g: val, b }).toHsl();
          setHue(h); setSaturation(s); setLightness(l);
        }} label="G" className="flex-1" />
        <ChannelInput value={b} onChange={(val) => {
          const { h, s, l } = colord({ r, g, b: val }).toHsl();
          setHue(h); setSaturation(s); setLightness(l);
        }} label="B" className="flex-1" />
        <ChannelInput value={Math.round(alpha)} onChange={setAlpha} max={100} label="%" className="w-13" />
      </div>
    );
  }

  if (mode === 'hsl') {
    return (
      <div className={cn('flex gap-1', className)} {...props}>
        <ChannelInput value={Math.round(hue)} onChange={setHue} max={360} label="H" className="flex-1" />
        <ChannelInput value={Math.round(saturation)} onChange={setSaturation} max={100} label="S" className="flex-1" />
        <ChannelInput value={Math.round(lightness)} onChange={setLightness} max={100} label="L" className="flex-1" />
        <ChannelInput value={Math.round(alpha)} onChange={setAlpha} max={100} label="%" className="w-13" />
      </div>
    );
  }

  if (mode === 'css') {
    return (
      <div className={cn('flex w-full', className)} {...props}>
        <Input
          readOnly
          value={`rgba(${colo
Download .txt
gitextract_ox5y_6yy/

├── .github/
│   ├── FUNDING.yml
│   └── workflows/
│       └── winget.yml
├── .gitignore
├── .vscode/
│   └── extensions.json
├── LICENSE
├── README.md
├── components.json
├── index.html
├── package.json
├── src/
│   ├── App.css
│   ├── App.tsx
│   ├── components/
│   │   ├── custom-filter.tsx
│   │   ├── key-overlay.tsx
│   │   ├── keycaps/
│   │   │   ├── base.tsx
│   │   │   ├── index.tsx
│   │   │   ├── laptop.tsx
│   │   │   ├── lowprofile.tsx
│   │   │   ├── minimal.tsx
│   │   │   ├── pbt.tsx
│   │   │   └── press-count.tsx
│   │   ├── mouse-indicator.tsx
│   │   ├── mouse-overlay.tsx
│   │   ├── settings/
│   │   │   ├── about.tsx
│   │   │   ├── appearance.tsx
│   │   │   ├── general.tsx
│   │   │   ├── index.tsx
│   │   │   ├── keycap.tsx
│   │   │   └── mouse.tsx
│   │   ├── shortcut-recorder.tsx
│   │   ├── theme-mode-toggle.tsx
│   │   ├── theme-provider.tsx
│   │   └── ui/
│   │       ├── alert-dialog.tsx
│   │       ├── alignment-selector.tsx
│   │       ├── badge.tsx
│   │       ├── button-group.tsx
│   │       ├── button.tsx
│   │       ├── card.tsx
│   │       ├── collapsible.tsx
│   │       ├── color-picker.tsx
│   │       ├── combobox.tsx
│   │       ├── command.tsx
│   │       ├── dialog.tsx
│   │       ├── drawer.tsx
│   │       ├── dropdown-menu.tsx
│   │       ├── field.tsx
│   │       ├── gradient-picker.tsx
│   │       ├── icons.tsx
│   │       ├── input-group.tsx
│   │       ├── input.tsx
│   │       ├── item.tsx
│   │       ├── label.tsx
│   │       ├── multi-select.tsx
│   │       ├── number-input-buttons.tsx
│   │       ├── number-input-scrub.tsx
│   │       ├── number-input.tsx
│   │       ├── popover.tsx
│   │       ├── scroll-area.tsx
│   │       ├── select.tsx
│   │       ├── separator.tsx
│   │       ├── sheet.tsx
│   │       ├── sidebar-item.tsx
│   │       ├── skeleton.tsx
│   │       ├── slider.tsx
│   │       ├── sonner.tsx
│   │       ├── switch.tsx
│   │       ├── tabs.tsx
│   │       ├── textarea.tsx
│   │       ├── toggle-group.tsx
│   │       ├── toggle.tsx
│   │       └── tooltip.tsx
│   ├── lib/
│   │   ├── keymaps.ts
│   │   └── utils.ts
│   ├── main.tsx
│   ├── pages/
│   │   ├── settings.tsx
│   │   └── visualization.tsx
│   ├── stores/
│   │   ├── key_event.ts
│   │   ├── key_style.ts
│   │   ├── storage.ts
│   │   └── sync.ts
│   ├── types/
│   │   ├── event.ts
│   │   └── style.ts
│   └── vite-env.d.ts
├── src-tauri/
│   ├── .gitignore
│   ├── 2
│   ├── Cargo.toml
│   ├── build.rs
│   ├── capabilities/
│   │   └── default.json
│   ├── crates/
│   │   └── rdev/
│   │       ├── .gitignore
│   │       ├── Cargo.toml
│   │       ├── LICENSE
│   │       ├── README.md
│   │       ├── rustfmt.toml
│   │       └── src/
│   │           ├── codes_conv.rs
│   │           ├── keycodes/
│   │           │   ├── android.rs
│   │           │   ├── chrome.rs
│   │           │   ├── linux.rs
│   │           │   ├── macos.rs
│   │           │   ├── macos_virtual_keycodes.rs
│   │           │   ├── mod.rs
│   │           │   ├── usb_hid.rs
│   │           │   └── windows.rs
│   │           ├── lib.rs
│   │           ├── linux/
│   │           │   ├── common.rs
│   │           │   ├── display.rs
│   │           │   ├── grab.rs
│   │           │   ├── keyboard.rs
│   │           │   ├── listen.rs
│   │           │   ├── mod.rs
│   │           │   └── simulate.rs
│   │           ├── macos/
│   │           │   ├── common.rs
│   │           │   ├── display.rs
│   │           │   ├── grab.rs
│   │           │   ├── keyboard.rs
│   │           │   ├── listen.rs
│   │           │   ├── mod.rs
│   │           │   └── simulate.rs
│   │           ├── rdev.rs
│   │           └── windows/
│   │               ├── common.rs
│   │               ├── display.rs
│   │               ├── grab.rs
│   │               ├── keyboard.rs
│   │               ├── listen.rs
│   │               ├── mod.rs
│   │               └── simulate.rs
│   ├── icons/
│   │   └── icon.icns
│   ├── src/
│   │   ├── app/
│   │   │   ├── commands.rs
│   │   │   ├── event.rs
│   │   │   ├── mod.rs
│   │   │   ├── state.rs
│   │   │   └── window.rs
│   │   ├── lib.rs
│   │   └── main.rs
│   ├── tauri.conf.json
│   └── tauri.windows.conf.json
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
Download .txt
SYMBOL INDEX (639 symbols across 88 files)

FILE: src-tauri/build.rs
  function main (line 1) | fn main() {

FILE: src-tauri/crates/rdev/src/codes_conv.rs
  function macos_iso_code_from_key (line 34) | fn macos_iso_code_from_key(key: Key) -> Option<KeyCode> {
  function macos_keycode_from_code_ (line 44) | fn macos_keycode_from_code_(code: KeyCode) -> Key {
  function test_usb_hid_code_to_macos_code (line 146) | fn test_usb_hid_code_to_macos_code() {
  function test_usb_hid_code_to_windows_scan_code (line 167) | fn test_usb_hid_code_to_windows_scan_code() {
  function test_usb_hid_code_to_linux_key_code (line 188) | fn test_usb_hid_code_to_linux_key_code() {

FILE: src-tauri/crates/rdev/src/keycodes/android.rs
  function test_reversible (line 127) | fn test_reversible() {

FILE: src-tauri/crates/rdev/src/keycodes/chrome.rs
  constant RESERVED_UNKNOWN_CODE (line 3) | pub const RESERVED_UNKNOWN_CODE: u32 = 0;
  function test_reversible (line 177) | fn test_reversible() {

FILE: src-tauri/crates/rdev/src/keycodes/linux.rs
  function test_reversible (line 167) | fn test_reversible() {

FILE: src-tauri/crates/rdev/src/keycodes/macos.rs
  function test_reversible (line 169) | fn test_reversible() {

FILE: src-tauri/crates/rdev/src/keycodes/macos_virtual_keycodes.rs
  type CGKeyCode (line 6) | pub type CGKeyCode = u32;
  type CGKeyCode (line 9) | pub type CGKeyCode = core_graphics::event::CGKeyCode;
  constant kVK_ANSI_A (line 11) | pub const kVK_ANSI_A: CGKeyCode = 0;
  constant kVK_ANSI_S (line 12) | pub const kVK_ANSI_S: CGKeyCode = 1;
  constant kVK_ANSI_D (line 13) | pub const kVK_ANSI_D: CGKeyCode = 2;
  constant kVK_ANSI_F (line 14) | pub const kVK_ANSI_F: CGKeyCode = 3;
  constant kVK_ANSI_H (line 15) | pub const kVK_ANSI_H: CGKeyCode = 4;
  constant kVK_ANSI_G (line 16) | pub const kVK_ANSI_G: CGKeyCode = 5;
  constant kVK_ANSI_Z (line 17) | pub const kVK_ANSI_Z: CGKeyCode = 6;
  constant kVK_ANSI_X (line 18) | pub const kVK_ANSI_X: CGKeyCode = 7;
  constant kVK_ANSI_C (line 19) | pub const kVK_ANSI_C: CGKeyCode = 8;
  constant kVK_ANSI_V (line 20) | pub const kVK_ANSI_V: CGKeyCode = 9;
  constant kVK_ANSI_B (line 21) | pub const kVK_ANSI_B: CGKeyCode = 11;
  constant kVK_ANSI_Q (line 22) | pub const kVK_ANSI_Q: CGKeyCode = 12;
  constant kVK_ANSI_W (line 23) | pub const kVK_ANSI_W: CGKeyCode = 13;
  constant kVK_ANSI_E (line 24) | pub const kVK_ANSI_E: CGKeyCode = 14;
  constant kVK_ANSI_R (line 25) | pub const kVK_ANSI_R: CGKeyCode = 15;
  constant kVK_ANSI_Y (line 26) | pub const kVK_ANSI_Y: CGKeyCode = 16;
  constant kVK_ANSI_T (line 27) | pub const kVK_ANSI_T: CGKeyCode = 17;
  constant kVK_ANSI_1 (line 28) | pub const kVK_ANSI_1: CGKeyCode = 18;
  constant kVK_ANSI_2 (line 29) | pub const kVK_ANSI_2: CGKeyCode = 19;
  constant kVK_ANSI_3 (line 30) | pub const kVK_ANSI_3: CGKeyCode = 20;
  constant kVK_ANSI_4 (line 31) | pub const kVK_ANSI_4: CGKeyCode = 21;
  constant kVK_ANSI_6 (line 32) | pub const kVK_ANSI_6: CGKeyCode = 22;
  constant kVK_ANSI_5 (line 33) | pub const kVK_ANSI_5: CGKeyCode = 23;
  constant kVK_ANSI_Equal (line 34) | pub const kVK_ANSI_Equal: CGKeyCode = 24;
  constant kVK_ANSI_9 (line 35) | pub const kVK_ANSI_9: CGKeyCode = 25;
  constant kVK_ANSI_7 (line 36) | pub const kVK_ANSI_7: CGKeyCode = 26;
  constant kVK_ANSI_Minus (line 37) | pub const kVK_ANSI_Minus: CGKeyCode = 27;
  constant kVK_ANSI_8 (line 38) | pub const kVK_ANSI_8: CGKeyCode = 28;
  constant kVK_ANSI_0 (line 39) | pub const kVK_ANSI_0: CGKeyCode = 29;
  constant kVK_ANSI_RightBracket (line 40) | pub const kVK_ANSI_RightBracket: CGKeyCode = 30;
  constant kVK_ANSI_O (line 41) | pub const kVK_ANSI_O: CGKeyCode = 31;
  constant kVK_ANSI_U (line 42) | pub const kVK_ANSI_U: CGKeyCode = 32;
  constant kVK_ANSI_LeftBracket (line 43) | pub const kVK_ANSI_LeftBracket: CGKeyCode = 33;
  constant kVK_ANSI_I (line 44) | pub const kVK_ANSI_I: CGKeyCode = 34;
  constant kVK_ANSI_P (line 45) | pub const kVK_ANSI_P: CGKeyCode = 35;
  constant kVK_ANSI_L (line 46) | pub const kVK_ANSI_L: CGKeyCode = 37;
  constant kVK_ANSI_J (line 47) | pub const kVK_ANSI_J: CGKeyCode = 38;
  constant kVK_ANSI_Quote (line 48) | pub const kVK_ANSI_Quote: CGKeyCode = 39;
  constant kVK_ANSI_K (line 49) | pub const kVK_ANSI_K: CGKeyCode = 40;
  constant kVK_ANSI_Semicolon (line 50) | pub const kVK_ANSI_Semicolon: CGKeyCode = 41;
  constant kVK_ANSI_Backslash (line 51) | pub const kVK_ANSI_Backslash: CGKeyCode = 42;
  constant kVK_ANSI_Comma (line 52) | pub const kVK_ANSI_Comma: CGKeyCode = 43;
  constant kVK_ANSI_Slash (line 53) | pub const kVK_ANSI_Slash: CGKeyCode = 44;
  constant kVK_ANSI_N (line 54) | pub const kVK_ANSI_N: CGKeyCode = 45;
  constant kVK_ANSI_M (line 55) | pub const kVK_ANSI_M: CGKeyCode = 46;
  constant kVK_ANSI_Period (line 56) | pub const kVK_ANSI_Period: CGKeyCode = 47;
  constant kVK_ANSI_Grave (line 57) | pub const kVK_ANSI_Grave: CGKeyCode = 50;
  constant kVK_ANSI_KeypadDecimal (line 58) | pub const kVK_ANSI_KeypadDecimal: CGKeyCode = 65;
  constant kVK_ANSI_KeypadMultiply (line 59) | pub const kVK_ANSI_KeypadMultiply: CGKeyCode = 67;
  constant kVK_ANSI_KeypadPlus (line 60) | pub const kVK_ANSI_KeypadPlus: CGKeyCode = 69;
  constant kVK_ANSI_KeypadClear (line 61) | pub const kVK_ANSI_KeypadClear: CGKeyCode = 71;
  constant kVK_ANSI_KeypadDivide (line 62) | pub const kVK_ANSI_KeypadDivide: CGKeyCode = 75;
  constant kVK_ANSI_KeypadEnter (line 63) | pub const kVK_ANSI_KeypadEnter: CGKeyCode = 76;
  constant kVK_ANSI_KeypadMinus (line 64) | pub const kVK_ANSI_KeypadMinus: CGKeyCode = 78;
  constant kVK_ANSI_KeypadEquals (line 65) | pub const kVK_ANSI_KeypadEquals: CGKeyCode = 81;
  constant kVK_ANSI_Keypad0 (line 66) | pub const kVK_ANSI_Keypad0: CGKeyCode = 82;
  constant kVK_ANSI_Keypad1 (line 67) | pub const kVK_ANSI_Keypad1: CGKeyCode = 83;
  constant kVK_ANSI_Keypad2 (line 68) | pub const kVK_ANSI_Keypad2: CGKeyCode = 84;
  constant kVK_ANSI_Keypad3 (line 69) | pub const kVK_ANSI_Keypad3: CGKeyCode = 85;
  constant kVK_ANSI_Keypad4 (line 70) | pub const kVK_ANSI_Keypad4: CGKeyCode = 86;
  constant kVK_ANSI_Keypad5 (line 71) | pub const kVK_ANSI_Keypad5: CGKeyCode = 87;
  constant kVK_ANSI_Keypad6 (line 72) | pub const kVK_ANSI_Keypad6: CGKeyCode = 88;
  constant kVK_ANSI_Keypad7 (line 73) | pub const kVK_ANSI_Keypad7: CGKeyCode = 89;
  constant kVK_ANSI_Keypad8 (line 74) | pub const kVK_ANSI_Keypad8: CGKeyCode = 91;
  constant kVK_ANSI_Keypad9 (line 75) | pub const kVK_ANSI_Keypad9: CGKeyCode = 92;
  constant kVK_Return (line 77) | pub const kVK_Return: CGKeyCode = 36;
  constant kVK_Tab (line 78) | pub const kVK_Tab: CGKeyCode = 48;
  constant kVK_Space (line 79) | pub const kVK_Space: CGKeyCode = 49;
  constant kVK_Delete (line 80) | pub const kVK_Delete: CGKeyCode = 51;
  constant kVK_Escape (line 81) | pub const kVK_Escape: CGKeyCode = 53;
  constant kVK_Command (line 82) | pub const kVK_Command: CGKeyCode = 55;
  constant kVK_Shift (line 83) | pub const kVK_Shift: CGKeyCode = 56;
  constant kVK_CapsLock (line 84) | pub const kVK_CapsLock: CGKeyCode = 57;
  constant kVK_Option (line 85) | pub const kVK_Option: CGKeyCode = 58;
  constant kVK_Control (line 86) | pub const kVK_Control: CGKeyCode = 59;
  constant kVK_RightCommand (line 87) | pub const kVK_RightCommand: CGKeyCode = 54;
  constant kVK_RightShift (line 88) | pub const kVK_RightShift: CGKeyCode = 60;
  constant kVK_RightOption (line 89) | pub const kVK_RightOption: CGKeyCode = 61;
  constant kVK_RightControl (line 90) | pub const kVK_RightControl: CGKeyCode = 62;
  constant kVK_Function (line 91) | pub const kVK_Function: CGKeyCode = 63;
  constant kVK_F17 (line 92) | pub const kVK_F17: CGKeyCode = 64;
  constant kVK_VolumeUp (line 93) | pub const kVK_VolumeUp: CGKeyCode = 72;
  constant kVK_VolumeDown (line 94) | pub const kVK_VolumeDown: CGKeyCode = 73;
  constant kVK_Mute (line 95) | pub const kVK_Mute: CGKeyCode = 74;
  constant kVK_F18 (line 96) | pub const kVK_F18: CGKeyCode = 79;
  constant kVK_F19 (line 97) | pub const kVK_F19: CGKeyCode = 80;
  constant kVK_F20 (line 98) | pub const kVK_F20: CGKeyCode = 90;
  constant kVK_F5 (line 99) | pub const kVK_F5: CGKeyCode = 96;
  constant kVK_F6 (line 100) | pub const kVK_F6: CGKeyCode = 97;
  constant kVK_F7 (line 101) | pub const kVK_F7: CGKeyCode = 98;
  constant kVK_F3 (line 102) | pub const kVK_F3: CGKeyCode = 99;
  constant kVK_F8 (line 103) | pub const kVK_F8: CGKeyCode = 100;
  constant kVK_F9 (line 104) | pub const kVK_F9: CGKeyCode = 101;
  constant kVK_F11 (line 105) | pub const kVK_F11: CGKeyCode = 103;
  constant kVK_F13 (line 106) | pub const kVK_F13: CGKeyCode = 105;
  constant kVK_F16 (line 107) | pub const kVK_F16: CGKeyCode = 106;
  constant kVK_F14 (line 108) | pub const kVK_F14: CGKeyCode = 107;
  constant kVK_F10 (line 109) | pub const kVK_F10: CGKeyCode = 109;
  constant kVK_F12 (line 110) | pub const kVK_F12: CGKeyCode = 111;
  constant kVK_F15 (line 111) | pub const kVK_F15: CGKeyCode = 113;
  constant kVK_Help (line 112) | pub const kVK_Help: CGKeyCode = 114;
  constant kVK_Home (line 113) | pub const kVK_Home: CGKeyCode = 115;
  constant kVK_PageUp (line 114) | pub const kVK_PageUp: CGKeyCode = 116;
  constant kVK_ForwardDelete (line 115) | pub const kVK_ForwardDelete: CGKeyCode = 117;
  constant kVK_F4 (line 116) | pub const kVK_F4: CGKeyCode = 118;
  constant kVK_End (line 117) | pub const kVK_End: CGKeyCode = 119;
  constant kVK_F2 (line 118) | pub const kVK_F2: CGKeyCode = 120;
  constant kVK_PageDown (line 119) | pub const kVK_PageDown: CGKeyCode = 121;
  constant kVK_F1 (line 120) | pub const kVK_F1: CGKeyCode = 122;
  constant kVK_LeftArrow (line 121) | pub const kVK_LeftArrow: CGKeyCode = 123;
  constant kVK_RightArrow (line 122) | pub const kVK_RightArrow: CGKeyCode = 124;
  constant kVK_DownArrow (line 123) | pub const kVK_DownArrow: CGKeyCode = 125;
  constant kVK_UpArrow (line 124) | pub const kVK_UpArrow: CGKeyCode = 126;
  constant kVK_ISO_Section (line 126) | pub const kVK_ISO_Section: CGKeyCode = 10;
  constant kVK_JIS_Yen (line 128) | pub const kVK_JIS_Yen: CGKeyCode = 93;
  constant kVK_JIS_Underscore (line 129) | pub const kVK_JIS_Underscore: CGKeyCode = 94;
  constant kVK_JIS_KeypadComma (line 130) | pub const kVK_JIS_KeypadComma: CGKeyCode = 95;
  constant kVK_JIS_Eisu (line 131) | pub const kVK_JIS_Eisu: CGKeyCode = 102;
  constant kVK_JIS_Kana (line 132) | pub const kVK_JIS_Kana: CGKeyCode = 104;
  constant kVK_Context_Menu (line 134) | pub const kVK_Context_Menu: CGKeyCode = 110;
  constant kVK_Unknown (line 135) | pub const kVK_Unknown: CGKeyCode = 0xFFFF;

FILE: src-tauri/crates/rdev/src/keycodes/usb_hid.rs
  function test_reversible (line 183) | fn test_reversible() {

FILE: src-tauri/crates/rdev/src/keycodes/windows.rs
  function test_reversible (line 233) | fn test_reversible() {

FILE: src-tauri/crates/rdev/src/lib.rs
  function listen (line 308) | pub fn listen<T>(callback: T) -> Result<(), ListenError>
  function simulate (line 348) | pub fn simulate(event_type: &EventType) -> Result<(), SimulateError> {
  function display_size (line 362) | pub fn display_size() -> Result<(u64, u64), DisplayError> {
  function grab (line 411) | pub fn grab<T>(callback: T) -> Result<(), GrabError>
  function keyboard_only (line 419) | pub(crate) fn keyboard_only() -> bool {
  function test_keyboard_state (line 430) | fn test_keyboard_state() {

FILE: src-tauri/crates/rdev/src/linux/common.rs
  constant TRUE (line 10) | pub const TRUE: c_int = 1;
  constant FALSE (line 11) | pub const FALSE: c_int = 0;
  function convert_event (line 16) | pub fn convert_event(code: c_uchar, type_: c_int, x: f64, y: f64) -> Opt...
  function convert (line 56) | pub fn convert(
  type Display (line 76) | pub struct Display {
    method new (line 81) | pub fn new() -> Option<Display> {
    method get_size (line 91) | pub fn get_size(&self) -> Option<(u64, u64)> {
    method get_mouse_pos (line 106) | pub fn get_mouse_pos(&self) -> Option<(u64, u64)> {
  method drop (line 132) | fn drop(&mut self) {

FILE: src-tauri/crates/rdev/src/linux/display.rs
  function display_size (line 4) | pub fn display_size() -> Result<(u64, u64), DisplayError> {

FILE: src-tauri/crates/rdev/src/linux/grab.rs
  type GrabEvent (line 21) | enum GrabEvent {
  type GrabControl (line 26) | enum GrabControl {
  type KeyboardGrabber (line 32) | struct KeyboardGrabber {
    method create (line 54) | fn create() -> Result<Self, GrabError> {
    method start (line 89) | fn start(&self) -> Result<(), GrabError> {
  constant KEYPRESS_EVENT (line 47) | const KEYPRESS_EVENT: i32 = 2;
  constant GRAB_RECV (line 51) | const GRAB_RECV: Token = Token(0);
  method drop (line 106) | fn drop(&mut self) {
  function is_control (line 115) | fn is_control(unicode_info: &Option<UnicodeInfo>) -> bool {
  function convert_event (line 128) | fn convert_event(code: u32, is_press: bool) -> Event {
  function grab_keys (line 160) | fn grab_keys(display: Arc<Mutex<u64>>, grab_window: libc::c_ulong) {
  function ungrab_keys (line 177) | fn ungrab_keys(display: Arc<Mutex<u64>>) {
  function ungrab_keys_ (line 186) | fn ungrab_keys_(display: *mut xlib::Display) {
  function start_callback_event_thread (line 193) | fn start_callback_event_thread(recv: Receiver<GrabEvent>) {
  function start_grab_service (line 210) | fn start_grab_service() -> Result<(), GrabError> {
  function read_x_event (line 228) | fn read_x_event(x_event: &mut xlib::XEvent, display: *mut xlib::Display) {
  function start_grab_control_thread (line 245) | fn start_grab_control_thread(
  function loop_poll_x_event (line 277) | fn loop_poll_x_event(display: Arc<Mutex<u64>>, mut poll: Poll) {
  function start_grab (line 307) | fn start_grab() -> Result<(), GrabError> {
  function start_grab_thread (line 312) | fn start_grab_thread() {
  function send_grab_control (line 339) | fn send_grab_control(data: GrabControl) {
  function enable_grab (line 354) | pub fn enable_grab() {
  function disable_grab (line 359) | pub fn disable_grab() {
  function is_grabbed (line 364) | pub fn is_grabbed() -> bool {
  function start_grab_listen (line 368) | pub fn start_grab_listen<T>(callback: T) -> Result<(), GrabError>
  function exit_grab_listen (line 386) | pub fn exit_grab_listen() {

FILE: src-tauri/crates/rdev/src/linux/keyboard.rs
  type MyXIM (line 11) | pub struct MyXIM(xlib::XIM);
  type MyXIC (line 16) | pub struct MyXIC(xlib::XIC);
  type MyDisplay (line 21) | pub struct MyDisplay(*mut xlib::Display);
  type Keyboard (line 26) | pub struct Keyboard {
    method new (line 46) | pub fn new() -> Option<Keyboard> {
    method get_current_modifiers (line 133) | pub(crate) unsafe fn get_current_modifiers(&mut self) -> Option<u32> {
    method unicode_from_code (line 161) | pub(crate) unsafe fn unicode_from_code(
    method is_dead (line 249) | pub fn is_dead(&mut self) -> bool {
    method keysym (line 259) | pub fn keysym(&self) -> u32 {
  method drop (line 37) | fn drop(&mut self) {
  method add (line 265) | fn add(&mut self, event_type: &EventType) -> Option<UnicodeInfo> {
  function xlookup_string (line 284) | pub fn xlookup_string(event: &mut XKeyEvent) -> KeySym {
  function test_thread_safety (line 310) | fn test_thread_safety() {
  function test_thread_safety_2 (line 326) | fn test_thread_safety_2() {

FILE: src-tauri/crates/rdev/src/linux/listen.rs
  function listen (line 16) | pub fn listen<T>(callback: T) -> Result<(), ListenError>
  type XRecordDatum (line 78) | struct XRecordDatum {
  function record_callback (line 92) | unsafe extern "C" fn record_callback(

FILE: src-tauri/crates/rdev/src/linux/simulate.rs
  function send_native (line 10) | unsafe fn send_native(event_type: &EventType, display: *mut xlib::Displa...
  function simulate (line 86) | pub fn simulate(event_type: &EventType) -> Result<(), SimulateError> {
  function send_native_char (line 107) | unsafe fn send_native_char(chr: char, pressed: bool, display: *mut xlib:...
  function simulate_char (line 135) | pub fn simulate_char(chr: char, pressed: bool) -> Result<(), SimulateErr...
  function simulate_unicode (line 156) | pub fn simulate_unicode(_unicode: u16) -> Result<(), SimulateError> {

FILE: src-tauri/crates/rdev/src/macos/common.rs
  type CFMachPortRef (line 18) | pub type CFMachPortRef = *const c_void;
  type CFIndex (line 19) | pub type CFIndex = u64;
  type CFAllocatorRef (line 20) | pub type CFAllocatorRef = id;
  type CFRunLoopSourceRef (line 21) | pub type CFRunLoopSourceRef = id;
  type CFRunLoopRef (line 22) | pub type CFRunLoopRef = id;
  type CFRunLoopMode (line 23) | pub type CFRunLoopMode = id;
  type CGEventTapProxy (line 24) | pub type CGEventTapProxy = id;
  type CGEventRef (line 25) | pub type CGEventRef = CGEvent;
  type FourCharCode (line 26) | pub type FourCharCode = ::std::os::raw::c_uint;
  type OSType (line 27) | pub type OSType = FourCharCode;
  type PhysicalKeyboardLayoutType (line 28) | pub type PhysicalKeyboardLayoutType = OSType;
  type SInt16 (line 29) | pub type SInt16 = ::std::os::raw::c_short;
  constant kUnknownType (line 32) | pub const kUnknownType: FourCharCode = 1061109567;
  constant kKeyboardJIS (line 34) | pub const kKeyboardJIS: PhysicalKeyboardLayoutType = 1246319392;
  constant kKeyboardANSI (line 36) | pub const kKeyboardANSI: PhysicalKeyboardLayoutType = 1095652169;
  constant kKeyboardISO (line 38) | pub const kKeyboardISO: PhysicalKeyboardLayoutType = 1230196512;
  constant kKeyboardUnknown (line 40) | pub const kKeyboardUnknown: PhysicalKeyboardLayoutType = 1061109567;
  type CGEventTapPlacement (line 43) | pub type CGEventTapPlacement = u32;
  constant kCGHeadInsertEventTap (line 45) | pub const kCGHeadInsertEventTap: u32 = 0;
  type CGEventTapOption (line 50) | pub enum CGEventTapOption {
  type CGEventMask (line 61) | pub type CGEventMask = u64;
  constant kCGEventMaskForAllEvents (line 63) | pub const kCGEventMaskForAllEvents: u64 = (1 << CGEventType::LeftMouseDo...
  function CGEventTapCreate (line 81) | pub fn CGEventTapCreate(
  function CGEventSourceKeyState (line 89) | pub fn CGEventSourceKeyState(state_id: CGEventSourceStateID, key: CGKeyC...
  function CFMachPortCreateRunLoopSource (line 90) | pub fn CFMachPortCreateRunLoopSource(
  function CFRunLoopGetCurrent (line 95) | pub fn CFRunLoopGetCurrent() -> CFRunLoopRef;
  function CFRunLoopAddSource (line 96) | pub fn CFRunLoopAddSource(rl: CFRunLoopRef, source: CFRunLoopSourceRef, ...
  function CFRunLoopGetMain (line 97) | pub fn CFRunLoopGetMain() -> CFRunLoopRef;
  function CGEventTapEnable (line 98) | pub fn CGEventTapEnable(tap: CFMachPortRef, enable: bool);
  function CFRunLoopRun (line 99) | pub fn CFRunLoopRun();
  function CFRunLoopStop (line 100) | pub fn CFRunLoopStop(rl: CFRunLoopRef);
  function LMGetKbdType (line 109) | pub fn LMGetKbdType() -> u8;
  function KBGetLayoutType (line 110) | pub fn KBGetLayoutType(iKeyboardType: SInt16) -> PhysicalKeyboardLayoutT...
  type QCallback (line 113) | pub type QCallback = unsafe extern "C" fn(
  function kb_get_layout_type (line 122) | fn kb_get_layout_type() -> PhysicalKeyboardLayoutType {
  function map_keycode (line 128) | pub fn map_keycode(code: CGKeyCode) -> CGKeyCode {
  function set_is_main_thread (line 148) | pub fn set_is_main_thread(b: bool) {
  function get_code (line 155) | unsafe fn get_code(cg_event: &CGEvent) -> Option<CGKeyCode> {
  function convert (line 162) | pub unsafe fn convert(
  function key_to_name (line 266) | fn key_to_name(key: Key) -> &'static str {
  function test_KBGetLayoutType (line 325) | fn test_KBGetLayoutType() {

FILE: src-tauri/crates/rdev/src/macos/display.rs
  function display_size (line 4) | pub fn display_size() -> Result<(u64, u64), DisplayError> {

FILE: src-tauri/crates/rdev/src/macos/grab.rs
  function raw_callback (line 11) | unsafe extern "C" fn raw_callback(
  function is_grabbed (line 36) | pub fn is_grabbed() -> bool {
  function grab (line 42) | pub fn grab<T>(callback: T) -> Result<(), GrabError>
  function exit_grab (line 78) | pub fn exit_grab() -> Result<(), GrabError> {

FILE: src-tauri/crates/rdev/src/macos/keyboard.rs
  type TISInputSourceRef (line 12) | type TISInputSourceRef = *mut c_void;
  type ModifierState (line 13) | type ModifierState = u32;
  type UniCharCount (line 14) | type UniCharCount = usize;
  type OptionBits (line 16) | type OptionBits = c_uint;
  constant kUCKeyTranslateDeadKeysBit (line 18) | const kUCKeyTranslateDeadKeysBit: OptionBits = 1 << 31;
  constant kUCKeyActionDown (line 20) | const kUCKeyActionDown: u16 = 0;
  constant NSEventModifierFlagCapsLock (line 23) | const NSEventModifierFlagCapsLock: u64 = 1 << 16;
  constant NSEventModifierFlagShift (line 25) | const NSEventModifierFlagShift: u64 = 1 << 17;
  constant NSEventModifierFlagControl (line 27) | const NSEventModifierFlagControl: u64 = 1 << 18;
  constant NSEventModifierFlagOption (line 29) | const NSEventModifierFlagOption: u64 = 1 << 19;
  constant NSEventModifierFlagCommand (line 31) | const NSEventModifierFlagCommand: u64 = 1 << 20;
  constant BUF_LEN (line 32) | const BUF_LEN: usize = 4;
  constant cmdKeyBit (line 35) | const cmdKeyBit: u32 = 8;
  constant shiftKeyBit (line 37) | const shiftKeyBit: u32 = 9;
  constant alphaLockBit (line 39) | const alphaLockBit: u32 = 10;
  constant optionKeyBit (line 41) | const optionKeyBit: u32 = 11;
  constant controlKeyBit (line 43) | const controlKeyBit: u32 = 12;
  constant cmdKey (line 46) | const cmdKey: u32 = 1 << cmdKeyBit;
  constant shiftKey (line 48) | const shiftKey: u32 = 1 << shiftKeyBit;
  constant alphaLock (line 50) | const alphaLock: u32 = 1 << alphaLockBit;
  constant optionKey (line 52) | const optionKey: u32 = 1 << optionKeyBit;
  constant controlKey (line 54) | const controlKey: u32 = 1 << controlKeyBit;
  function TISCopyCurrentKeyboardInputSource (line 65) | fn TISCopyCurrentKeyboardInputSource() -> TISInputSourceRef;
  function TISCopyCurrentKeyboardLayoutInputSource (line 66) | fn TISCopyCurrentKeyboardLayoutInputSource() -> TISInputSourceRef;
  function TISCopyCurrentASCIICapableKeyboardLayoutInputSource (line 67) | fn TISCopyCurrentASCIICapableKeyboardLayoutInputSource() -> TISInputSour...
  function TISGetInputSourceProperty (line 69) | fn TISGetInputSourceProperty(source: TISInputSourceRef, property: *const...
  function UCKeyTranslate (line 71) | fn UCKeyTranslate(
  type Keyboard (line 86) | pub struct Keyboard {
    method new (line 95) | pub fn new() -> Option<Keyboard> {
    method set_is_main_thread (line 105) | pub fn set_is_main_thread(&mut self, b: bool) {
    method modifier_state (line 109) | fn modifier_state(&self) -> ModifierState {
    method create_unicode_for_key (line 123) | pub(crate) unsafe fn create_unicode_for_key(
    method unicode_from_code (line 148) | unsafe fn unicode_from_code(
    method is_dead (line 245) | pub fn is_dead(&self) -> bool {
  method add (line 251) | fn add(&mut self, event_type: &EventType) -> Option<UnicodeInfo> {
  function flags_to_state (line 288) | pub unsafe fn flags_to_state(flags: u64) -> ModifierState {

FILE: src-tauri/crates/rdev/src/macos/listen.rs
  function raw_callback (line 11) | unsafe extern "C" fn raw_callback(
  function listen (line 33) | pub fn listen<T>(callback: T) -> Result<(), ListenError>

FILE: src-tauri/crates/rdev/src/macos/simulate.rs
  function set_mouse_extra_info (line 17) | pub fn set_mouse_extra_info(extra: i64) {
  function set_keyboard_extra_info (line 21) | pub fn set_keyboard_extra_info(extra: i64) {
  function workaround_fn (line 26) | fn workaround_fn(event: CGEvent, keycode: CGKeyCode) -> CGEvent {
  function convert_native_with_source (line 65) | unsafe fn convert_native_with_source(
  function convert_native (line 156) | unsafe fn convert_native(event_type: &EventType) -> Option<CGEvent> {
  function get_current_mouse_location (line 162) | unsafe fn get_current_mouse_location() -> Option<CGPoint> {
  function simulate (line 168) | pub fn simulate(event_type: &EventType) -> Result<(), SimulateError> {
  type VirtualInput (line 180) | pub struct VirtualInput {
    method new (line 186) | pub fn new(state_id: CGEventSourceStateID, tap_loc: CGEventTapLocation...
    method simulate (line 193) | pub fn simulate(&self, event_type: &EventType) -> Result<(), SimulateE...
    method get_key_state (line 205) | pub fn get_key_state(state_id: CGEventSourceStateID, keycode: CGKeyCod...

FILE: src-tauri/crates/rdev/src/rdev.rs
  type GrabCallback (line 10) | pub type GrabCallback = fn(event: Event) -> Option<Event>;
  type ListenError (line 17) | pub enum ListenError {
  type GrabError (line 43) | pub enum GrabError {
    method from (line 84) | fn from(_: SimulateError) -> GrabError {
  type DisplayError (line 78) | pub enum DisplayError {
  type SimulateError (line 91) | pub struct SimulateError;
  method fmt (line 94) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  type Key (line 114) | pub enum Key {
  type KeyCode (line 268) | pub type KeyCode = u32;
  type KeyCode (line 270) | pub type KeyCode = crate::CGKeyCode;
  type RawKey (line 274) | pub enum RawKey {
  method default (line 283) | fn default() -> Self {
  type Button (line 293) | pub enum Button {
  type EventType (line 304) | pub enum EventType {
  type UnicodeInfo (line 331) | pub struct UnicodeInfo {
  type Event (line 345) | pub struct Event {
  type KeyboardState (line 376) | pub trait KeyboardState {
    method add (line 380) | fn add(&mut self, event_type: &EventType) -> Option<UnicodeInfo>;

FILE: src-tauri/crates/rdev/src/windows/common.rs
  constant TRUE (line 21) | pub const TRUE: i32 = 1;
  constant FALSE (line 23) | pub const FALSE: i32 = 0;
  function set_modifier (line 31) | pub fn set_modifier(key: Key, down: bool) {
  function get_modifier (line 35) | pub fn get_modifier(key: Key) -> bool {
  function get_code (line 39) | pub unsafe fn get_code(lpdata: LPARAM) -> DWORD {
  function get_scan_code (line 49) | pub unsafe fn get_scan_code(lpdata: LPARAM) -> DWORD {
  function get_point (line 64) | pub unsafe fn get_point(lpdata: LPARAM) -> (LONG, LONG) {
  function get_delta (line 71) | pub unsafe fn get_delta(lpdata: LPARAM) -> WORD {
  function get_button_code (line 75) | pub unsafe fn get_button_code(lpdata: LPARAM) -> WORD {
  function convert (line 80) | pub unsafe fn convert(param: WPARAM, lpdata: LPARAM) -> (Option<EventTyp...
  function vk_to_scancode (line 135) | pub fn vk_to_scancode(vk: u32) -> u32 {
  type RawCallback (line 143) | type RawCallback = unsafe extern "system" fn(code: c_int, param: WPARAM,...
  type HookError (line 144) | pub enum HookError {
  function set_key_hook (line 149) | pub unsafe fn set_key_hook(callback: RawCallback) -> Result<(), HookErro...
  function set_mouse_hook (line 160) | pub unsafe fn set_mouse_hook(callback: RawCallback) -> Result<(), HookEr...

FILE: src-tauri/crates/rdev/src/windows/display.rs
  function display_size (line 5) | pub fn display_size() -> Result<(u64, u64), DisplayError> {

FILE: src-tauri/crates/rdev/src/windows/grab.rs
  constant WM_USER_EXIT_HOOK (line 31) | const WM_USER_EXIT_HOOK: u32 = WM_USER + 1;
  function set_get_key_unicode (line 33) | pub fn set_get_key_unicode(b: bool) {
  function set_event_popup (line 39) | pub fn set_event_popup(b: bool) {
  function raw_callback (line 43) | unsafe fn raw_callback(
  function raw_callback_mouse (line 86) | unsafe extern "system" fn raw_callback_mouse(code: i32, param: usize, lp...
  function raw_callback_keyboard (line 92) | unsafe extern "system" fn raw_callback_keyboard(code: i32, param: usize,...
  method from (line 99) | fn from(error: HookError) -> Self {
  function do_hook (line 107) | fn do_hook<T>(callback: T) -> Result<(HHOOK, HHOOK), GrabError>
  function is_grabbed (line 144) | pub fn is_grabbed() -> bool {
  function grab (line 148) | pub fn grab<T>(callback: T) -> Result<(), GrabError>
  function exit_grab (line 208) | pub fn exit_grab() -> Result<(), GrabError> {

FILE: src-tauri/crates/rdev/src/windows/keyboard.rs
  constant VK_SHIFT_ (line 16) | const VK_SHIFT_: usize = VK_SHIFT as usize;
  constant VK_CAPITAL_ (line 17) | const VK_CAPITAL_: usize = VK_CAPITAL as usize;
  constant VK_LSHIFT_ (line 18) | const VK_LSHIFT_: usize = VK_LSHIFT as usize;
  constant VK_RSHIFT_ (line 19) | const VK_RSHIFT_: usize = VK_RSHIFT as usize;
  constant HIGHBIT (line 20) | const HIGHBIT: u8 = 0x80;
  type Keyboard (line 22) | pub struct Keyboard {
    method new (line 32) | pub fn new() -> Keyboard {
    method get_modifier (line 43) | pub(crate) fn get_modifier(&self, key: Key) -> bool {
    method set_modifier_ (line 58) | fn set_modifier_(&mut self, key1: c_int, key2: c_int, key: c_int, down...
    method set_modifier (line 68) | pub(crate) fn set_modifier(&mut self, key: Key, down: bool) {
    method set_event_popup (line 101) | pub(crate) fn set_event_popup(&mut self, b: bool) {
    method get_unicode (line 105) | pub(crate) unsafe fn get_unicode(&mut self, lpdata: LPARAM) -> Option<...
    method set_global_state (line 115) | pub(crate) unsafe fn set_global_state(&mut self) -> Option<()> {
    method get_code_name_unicode (line 205) | pub(crate) unsafe fn get_code_name_unicode(
    method clear_keyboard_buffer (line 304) | unsafe fn clear_keyboard_buffer(&self, code: UINT, scan_code: UINT, la...
    method is_dead (line 317) | pub fn is_dead(&mut self) -> bool {
  method add (line 323) | fn add(&mut self, event_type: &EventType) -> Option<UnicodeInfo> {

FILE: src-tauri/crates/rdev/src/windows/listen.rs
  method from (line 17) | fn from(error: HookError) -> Self {
  function raw_callback (line 25) | unsafe fn raw_callback(
  function raw_callback_mouse (line 51) | unsafe extern "system" fn raw_callback_mouse(code: i32, param: usize, lp...
  function raw_callback_keyboard (line 57) | unsafe extern "system" fn raw_callback_keyboard(code: i32, param: usize,...
  function listen (line 63) | pub fn listen<T>(callback: T) -> Result<(), ListenError>

FILE: src-tauri/crates/rdev/src/windows/simulate.rs
  function set_mouse_extra_info (line 27) | pub fn set_mouse_extra_info(extra: usize) {
  function set_keyboard_extra_info (line 31) | pub fn set_keyboard_extra_info(extra: usize) {
  function sim_mouse_event (line 35) | fn sim_mouse_event(flags: DWORD, data: DWORD, dx: LONG, dy: LONG) -> Res...
  function sim_keyboard_event (line 66) | fn sim_keyboard_event(flags: DWORD, vk: WORD, scan: WORD) -> Result<(), ...
  function get_layout (line 97) | fn get_layout() -> HKL {
  function simulate_key_event_rawkey (line 104) | fn simulate_key_event_rawkey(key: &RawKey, is_press: bool) -> Result<(),...
  function simulate_key_event_not_rawkey (line 116) | fn simulate_key_event_not_rawkey(key: &Key, is_press: bool) -> Result<()...
  function simulate (line 136) | pub fn simulate(event_type: &EventType) -> Result<(), SimulateError> {
  function simulate_code (line 195) | pub fn simulate_code(
  function simulate_key_unicode (line 226) | pub fn simulate_key_unicode(unicode_16: u16, try_unicode: bool) -> Resul...
  function simulate_char (line 266) | pub fn simulate_char(chr: char, try_unicode: bool) -> Result<(), Simulat...
  function simulate_unicode (line 270) | pub fn simulate_unicode(unicode: u16) -> Result<(), SimulateError> {
  function simulate_unistr (line 276) | pub fn simulate_unistr(unistr: &str) -> Result<(), SimulateError> {

FILE: src-tauri/src/app/commands.rs
  function log (line 8) | pub fn log(message: String) {
  function set_toggle_shortcut (line 13) | pub fn set_toggle_shortcut(app: tauri::AppHandle, shortcut: Vec<String>) {
  function set_main_window_monitor (line 20) | pub fn set_main_window_monitor(app: tauri::AppHandle, monitor_name: Stri...

FILE: src-tauri/src/app/event.rs
  type InputEvent (line 11) | pub enum InputEvent {
  type MouseButton (line 19) | pub enum MouseButton {
  function map_mouse_button (line 26) | pub fn map_mouse_button(button: Button) -> MouseButton {
  function start_listener (line 35) | pub fn start_listener(app_handle: AppHandle, toggle_menu_item: MenuItem<...

FILE: src-tauri/src/app/state.rs
  type AppState (line 6) | pub struct AppState {
    method new (line 17) | pub fn new(app: &tauri::AppHandle) -> Self {
    method toggle_listener (line 45) | pub fn toggle_listener(&mut self, app: &tauri::AppHandle, toggle: &tau...
  type KeyEventStore (line 70) | struct KeyEventStore {
  type KeyEventState (line 77) | struct KeyEventState {

FILE: src-tauri/src/app/window.rs
  function config_window (line 1) | pub fn config_window(window: &tauri::WebviewWindow) {

FILE: src-tauri/src/lib.rs
  function run (line 18) | pub fn run() {

FILE: src-tauri/src/main.rs
  function main (line 4) | fn main() {

FILE: src/App.tsx
  function App (line 11) | function App() {

FILE: src/components/custom-filter.tsx
  type KeyboardContextType (line 9) | interface KeyboardContextType {

FILE: src/components/keycaps/index.tsx
  type KeycapProps (line 8) | interface KeycapProps {

FILE: src/components/mouse-overlay.tsx
  constant MIN_CLICK_DISPLAY_MS (line 9) | const MIN_CLICK_DISPLAY_MS = 200;

FILE: src/components/settings/about.tsx
  constant VERSION (line 10) | const VERSION = "2.1.0"

FILE: src/components/settings/keycap.tsx
  type KeycapTheme (line 17) | interface KeycapTheme {

FILE: src/components/shortcut-recorder.tsx
  type ShortcutInputProps (line 7) | interface ShortcutInputProps {

FILE: src/components/theme-mode-toggle.tsx
  function ThemeModeToggle (line 12) | function ThemeModeToggle() {

FILE: src/components/theme-provider.tsx
  type Theme (line 3) | type Theme = "dark" | "light" | "system"
  type ThemeProviderProps (line 5) | type ThemeProviderProps = {
  type ThemeProviderState (line 11) | type ThemeProviderState = {
  function ThemeProvider (line 23) | function ThemeProvider({

FILE: src/components/ui/alert-dialog.tsx
  function AlertDialog (line 7) | function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
  function AlertDialogTrigger (line 11) | function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.P...
  function AlertDialogPortal (line 17) | function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Pro...
  function AlertDialogOverlay (line 23) | function AlertDialogOverlay({
  function AlertDialogContent (line 39) | function AlertDialogContent({
  function AlertDialogHeader (line 62) | function AlertDialogHeader({
  function AlertDialogFooter (line 75) | function AlertDialogFooter({
  function AlertDialogMedia (line 91) | function AlertDialogMedia({
  function AlertDialogTitle (line 104) | function AlertDialogTitle({
  function AlertDialogDescription (line 117) | function AlertDialogDescription({
  function AlertDialogAction (line 130) | function AlertDialogAction({
  function AlertDialogCancel (line 143) | function AlertDialogCancel({

FILE: src/components/ui/alignment-selector.tsx
  type AlignmentSelectorProps (line 7) | interface AlignmentSelectorProps {

FILE: src/components/ui/badge.tsx
  function Badge (line 26) | function Badge({

FILE: src/components/ui/button-group.tsx
  function ButtonGroup (line 25) | function ButtonGroup({
  function ButtonGroupText (line 41) | function ButtonGroupText({
  function ButtonGroupSeparator (line 64) | function ButtonGroupSeparator({

FILE: src/components/ui/button.tsx
  function Button (line 36) | function Button({

FILE: src/components/ui/card.tsx
  function Card (line 5) | function Card({
  function CardHeader (line 20) | function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
  function CardTitle (line 33) | function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
  function CardDescription (line 43) | function CardDescription({ className, ...props }: React.ComponentProps<"...
  function CardAction (line 53) | function CardAction({ className, ...props }: React.ComponentProps<"div">) {
  function CardContent (line 66) | function CardContent({ className, ...props }: React.ComponentProps<"div"...
  function CardFooter (line 76) | function CardFooter({ className, ...props }: React.ComponentProps<"div">) {

FILE: src/components/ui/collapsible.tsx
  function Collapsible (line 3) | function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
  function CollapsibleTrigger (line 7) | function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.P...
  function CollapsibleContent (line 13) | function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Pro...

FILE: src/components/ui/color-picker.tsx
  type ColorPickerContextValue (line 37) | interface ColorPickerContextValue {
  type ColorPickerProps (line 64) | type ColorPickerProps = HTMLAttributes<HTMLDivElement> & {

FILE: src/components/ui/combobox.tsx
  function ComboboxValue (line 19) | function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {
  function ComboboxTrigger (line 23) | function ComboboxTrigger({
  function ComboboxClear (line 40) | function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear....
  function ComboboxInput (line 53) | function ComboboxInput({
  function ComboboxContent (line 88) | function ComboboxContent({
  function ComboboxList (line 122) | function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Pr...
  function ComboboxItem (line 135) | function ComboboxItem({
  function ComboboxGroup (line 159) | function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group....
  function ComboboxLabel (line 169) | function ComboboxLabel({
  function ComboboxCollection (line 182) | function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.P...
  function ComboboxEmpty (line 188) | function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty....
  function ComboboxSeparator (line 198) | function ComboboxSeparator({
  function ComboboxChips (line 211) | function ComboboxChips({
  function ComboboxChip (line 225) | function ComboboxChip({
  function ComboboxChipsInput (line 256) | function ComboboxChipsInput({
  function useComboboxAnchor (line 272) | function useComboboxAnchor() {

FILE: src/components/ui/command.tsx
  function Command (line 19) | function Command({
  function CommandDialog (line 35) | function CommandDialog({
  function CommandInput (line 65) | function CommandInput({
  function CommandList (line 88) | function CommandList({
  function CommandEmpty (line 104) | function CommandEmpty({
  function CommandGroup (line 117) | function CommandGroup({
  function CommandSeparator (line 130) | function CommandSeparator({
  function CommandItem (line 143) | function CommandItem({
  function CommandShortcut (line 163) | function CommandShortcut({

FILE: src/components/ui/dialog.tsx
  function Dialog (line 9) | function Dialog({ ...props }: DialogPrimitive.Root.Props) {
  function DialogTrigger (line 13) | function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
  function DialogPortal (line 17) | function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
  function DialogClose (line 21) | function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
  function DialogOverlay (line 25) | function DialogOverlay({
  function DialogContent (line 38) | function DialogContent({
  function DialogHeader (line 78) | function DialogHeader({ className, ...props }: React.ComponentProps<"div...
  function DialogFooter (line 88) | function DialogFooter({
  function DialogTitle (line 115) | function DialogTitle({ className, ...props }: DialogPrimitive.Title.Prop...
  function DialogDescription (line 125) | function DialogDescription({

FILE: src/components/ui/drawer.tsx
  function Drawer (line 6) | function Drawer({
  function DrawerTrigger (line 12) | function DrawerTrigger({
  function DrawerPortal (line 18) | function DrawerPortal({
  function DrawerClose (line 24) | function DrawerClose({
  function DrawerOverlay (line 30) | function DrawerOverlay({
  function DrawerContent (line 43) | function DrawerContent({
  function DrawerHeader (line 66) | function DrawerHeader({ className, ...props }: React.ComponentProps<"div...
  function DrawerFooter (line 76) | function DrawerFooter({ className, ...props }: React.ComponentProps<"div...
  function DrawerTitle (line 86) | function DrawerTitle({
  function DrawerDescription (line 99) | function DrawerDescription({

FILE: src/components/ui/dropdown-menu.tsx
  function DropdownMenu (line 10) | function DropdownMenu({
  function DropdownMenuPortal (line 16) | function DropdownMenuPortal({
  function DropdownMenuTrigger (line 24) | function DropdownMenuTrigger({
  function DropdownMenuContent (line 35) | function DropdownMenuContent({
  function DropdownMenuGroup (line 54) | function DropdownMenuGroup({
  function DropdownMenuItem (line 62) | function DropdownMenuItem({
  function DropdownMenuCheckboxItem (line 85) | function DropdownMenuCheckboxItem({
  function DropdownMenuRadioGroup (line 114) | function DropdownMenuRadioGroup({
  function DropdownMenuRadioItem (line 125) | function DropdownMenuRadioItem({
  function DropdownMenuLabel (line 152) | function DropdownMenuLabel({
  function DropdownMenuSeparator (line 169) | function DropdownMenuSeparator({
  function DropdownMenuShortcut (line 182) | function DropdownMenuShortcut({
  function DropdownMenuSub (line 195) | function DropdownMenuSub({
  function DropdownMenuSubTrigger (line 201) | function DropdownMenuSubTrigger({
  function DropdownMenuSubContent (line 225) | function DropdownMenuSubContent({

FILE: src/components/ui/field.tsx
  function FieldSet (line 8) | function FieldSet({ className, ...props }: React.ComponentProps<"fieldse...
  function FieldLegend (line 18) | function FieldLegend({
  function FieldGroup (line 33) | function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
  function Field (line 62) | function Field({
  function FieldContent (line 78) | function FieldContent({ className, ...props }: React.ComponentProps<"div...
  function FieldLabel (line 91) | function FieldLabel({
  function FieldTitle (line 108) | function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
  function FieldDescription (line 121) | function FieldDescription({ className, ...props }: React.ComponentProps<...
  function FieldSeparator (line 136) | function FieldSeparator({
  function FieldError (line 163) | function FieldError({

FILE: src/components/ui/gradient-picker.tsx
  type GradientStop (line 49) | type GradientStop = {
  type GradientConfig (line 55) | type GradientConfig = {
  constant DEFAULT_STOPS (line 59) | const DEFAULT_STOPS: GradientStop[] = [
  type ColorPickerContextValue (line 118) | interface ColorPickerContextValue {
  type TabMode (line 479) | type TabMode = 'solid' | 'gradient';
  type ColorPickerProps (line 481) | type ColorPickerProps = HTMLAttributes<HTMLDivElement> & {

FILE: src/components/ui/icons.tsx
  function createCustomIcon (line 5) | function createCustomIcon(name: string, children: ReactNode) {

FILE: src/components/ui/input-group.tsx
  function InputGroup (line 11) | function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
  function InputGroupAddon (line 44) | function InputGroupAddon({
  function InputGroupButton (line 83) | function InputGroupButton({
  function InputGroupText (line 104) | function InputGroupText({ className, ...props }: React.ComponentProps<"s...
  function InputGroupInput (line 116) | function InputGroupInput({
  function InputGroupTextarea (line 129) | function InputGroupTextarea({

FILE: src/components/ui/input.tsx
  function Input (line 5) | function Input({ className, type, ...props }: React.ComponentProps<"inpu...

FILE: src/components/ui/item.tsx
  function ItemGrid (line 10) | function ItemGrid({ className, ...props }: React.ComponentProps<"div">) {
  function ItemGroup (line 25) | function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
  function ItemSeparator (line 39) | function ItemSeparator({
  function Item (line 75) | function Item({
  function ItemMedia (line 115) | function ItemMedia({
  function ItemContent (line 130) | function ItemContent({ className, ...props }: React.ComponentProps<"div"...
  function ItemTitle (line 143) | function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
  function ItemDescription (line 156) | function ItemDescription({ className, ...props }: React.ComponentProps<"...
  function ItemActions (line 169) | function ItemActions({ className, ...props }: React.ComponentProps<"div"...
  function ItemHeader (line 179) | function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
  function ItemFooter (line 192) | function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {

FILE: src/components/ui/label.tsx
  function Label (line 7) | function Label({ className, ...props }: React.ComponentProps<"label">) {

FILE: src/components/ui/multi-select.tsx
  type MultiSelectProps (line 22) | interface MultiSelectProps

FILE: src/components/ui/number-input-scrub.tsx
  type NumberScrubberProps (line 6) | interface NumberScrubberProps
  function NumberScrubber (line 18) | function NumberScrubber({

FILE: src/components/ui/number-input.tsx
  function NumberInput (line 4) | function NumberInput({ ...props }: NumberFieldProps) {

FILE: src/components/ui/popover.tsx
  function Popover (line 8) | function Popover({
  function PopoverTrigger (line 14) | function PopoverTrigger({
  function PopoverContent (line 20) | function PopoverContent({
  function PopoverAnchor (line 42) | function PopoverAnchor({
  function PopoverHeader (line 48) | function PopoverHeader({ className, ...props }: React.ComponentProps<"di...
  function PopoverTitle (line 58) | function PopoverTitle({ className, ...props }: React.ComponentProps<"h2"...
  function PopoverDescription (line 68) | function PopoverDescription({

FILE: src/components/ui/scroll-area.tsx
  function ScrollArea (line 5) | function ScrollArea({
  function ScrollBar (line 28) | function ScrollBar({

FILE: src/components/ui/select.tsx
  function Select (line 10) | function Select({
  function SelectGroup (line 16) | function SelectGroup({
  function SelectValue (line 29) | function SelectValue({
  function SelectTrigger (line 35) | function SelectTrigger({
  function SelectContent (line 61) | function SelectContent({
  function SelectLabel (line 93) | function SelectLabel({
  function SelectItem (line 106) | function SelectItem({
  function SelectSeparator (line 130) | function SelectSeparator({
  function SelectScrollUpButton (line 143) | function SelectScrollUpButton({
  function SelectScrollDownButton (line 158) | function SelectScrollDownButton({

FILE: src/components/ui/separator.tsx
  function Separator (line 5) | function Separator({

FILE: src/components/ui/sheet.tsx
  function Sheet (line 9) | function Sheet({ ...props }: SheetPrimitive.Root.Props) {
  function SheetTrigger (line 13) | function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {
  function SheetClose (line 17) | function SheetClose({ ...props }: SheetPrimitive.Close.Props) {
  function SheetPortal (line 21) | function SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {
  function SheetOverlay (line 25) | function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.P...
  function SheetContent (line 35) | function SheetContent({
  function SheetHeader (line 75) | function SheetHeader({ className, ...props }: React.ComponentProps<"div"...
  function SheetFooter (line 85) | function SheetFooter({ className, ...props }: React.ComponentProps<"div"...
  function SheetTitle (line 95) | function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
  function SheetDescription (line 105) | function SheetDescription({

FILE: src/components/ui/skeleton.tsx
  function Skeleton (line 3) | function Skeleton({ className, ...props }: React.ComponentProps<"div">) {

FILE: src/components/ui/slider.tsx
  function Slider (line 8) | function Slider({

FILE: src/components/ui/switch.tsx
  function Switch (line 5) | function Switch({

FILE: src/components/ui/tabs.tsx
  function Tabs (line 9) | function Tabs({
  function TabsList (line 42) | function TabsList({
  function TabsTrigger (line 58) | function TabsTrigger({
  function TabsContent (line 77) | function TabsContent({

FILE: src/components/ui/textarea.tsx
  function Textarea (line 5) | function Textarea({ className, ...props }: React.ComponentProps<"textare...

FILE: src/components/ui/toggle-group.tsx
  function ToggleGroup (line 22) | function ToggleGroup({
  function ToggleGroupItem (line 77) | function ToggleGroupItem({

FILE: src/components/ui/toggle.tsx
  function Toggle (line 30) | function Toggle({

FILE: src/components/ui/tooltip.tsx
  function TooltipProvider (line 5) | function TooltipProvider({
  function Tooltip (line 18) | function Tooltip({ ...props }: TooltipPrimitive.Root.Props) {
  function TooltipTrigger (line 26) | function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {
  function TooltipContent (line 30) | function TooltipContent({

FILE: src/lib/keymaps.ts
  type SwitchPlatformConfig (line 8) | interface SwitchPlatformConfig<T> {
  function switchPlatform (line 14) | function switchPlatform<T>(config: SwitchPlatformConfig<T>): T {
  type DisplayData (line 24) | interface DisplayData {

FILE: src/lib/utils.ts
  function cn (line 5) | function cn(...inputs: ClassValue[]) {
  function lighten (line 9) | function lighten(hex: string, l: number): string {
  function darken (line 13) | function darken(hex: string, l: number): string {

FILE: src/pages/visualization.tsx
  function Visualization (line 12) | function Visualization() {

FILE: src/stores/key_event.ts
  constant KEY_EVENT_STORE (line 8) | const KEY_EVENT_STORE = "key_event_store";
  constant SCROLL_LINGER_MS (line 9) | const SCROLL_LINGER_MS = 300;
  type KeyGroup (line 11) | interface KeyGroup {
  type KeyEventState (line 16) | interface KeyEventState {
  type KeyEventActions (line 41) | interface KeyEventActions {
  type KeyEventStore (line 63) | type KeyEventStore = KeyEventState & KeyEventActions;
  method setDragThreshold (line 86) | setDragThreshold(value: number) {
  method setFilter (line 89) | setFilter(value: "none" | "modifiers" | "custom") {
  method setAllowedKeys (line 92) | setAllowedKeys(keys: string[]) {
  method setShowEventHistory (line 95) | setShowEventHistory(value: boolean) {
  method setMaxHistory (line 98) | setMaxHistory(value: number) {
  method setLingerDurationMs (line 101) | setLingerDurationMs(value: number) {
  method setToggleShortcut (line 104) | setToggleShortcut(value: string[]) {
  method onEvent (line 107) | onEvent(event: EventPayload) {
  method onKeyPress (line 136) | onKeyPress(event: RawKeyEvent) {
  method ignoreEvent (line 212) | ignoreEvent(pressedKeys) {
  method onKeyRelease (line 222) | onKeyRelease(event: RawKeyEvent) {
  method onMouseMove (line 239) | onMouseMove(event: MouseMoveEvent) {
  method onMouseButtonPress (line 283) | onMouseButtonPress(event: MouseButtonEvent) {
  method onMouseButtonRelease (line 299) | onMouseButtonRelease(event: MouseButtonEvent) {
  method onMouseWheel (line 320) | onMouseWheel(event: MouseWheelEvent) {
  method tick (line 337) | tick() {

FILE: src/stores/key_style.ts
  constant KEY_STYLE_STORE (line 10) | const KEY_STYLE_STORE = "key_style_store";
  type AppearanceSettings (line 12) | interface AppearanceSettings {
  type LayoutSettings (line 23) | interface LayoutSettings {
  type ColorSettings (line 30) | interface ColorSettings {
  type ModifierSettings (line 36) | interface ModifierSettings {
  type TextSettings (line 44) | interface TextSettings {
  type BorderSettings (line 52) | interface BorderSettings {
  type BackgroundSettings (line 59) | interface BackgroundSettings {
  type MouseSettings (line 64) | interface MouseSettings {
  type KeyStyleState (line 76) | interface KeyStyleState {
  type KeyStyleActions (line 87) | interface KeyStyleActions {
  type KeyStyleStore (line 100) | type KeyStyleStore = KeyStyleState & KeyStyleActions;

FILE: src/stores/sync.ts
  type StoreUpdateEventPayload (line 5) | interface StoreUpdateEventPayload<T> {
  function tauriEventMiddleware (line 11) | function tauriEventMiddleware<T>(storeName: string, config: StateCreator...
  type StoreFactory (line 63) | type StoreFactory<T> = (isSender: boolean) => UseBoundStore<StoreApi<T>>;
  function createSyncedStore (line 65) | function createSyncedStore<T>(
  function listenForUpdates (line 87) | function listenForUpdates<T>(

FILE: src/types/event.ts
  type EventPayload (line 1) | type EventPayload =
  type RawKeyEvent (line 7) | interface RawKeyEvent {
  type MouseButtonEvent (line 13) | interface MouseButtonEvent {
  type MouseMoveEvent (line 19) | interface MouseMoveEvent {
  type MouseWheelEvent (line 25) | interface MouseWheelEvent {
  type MouseButton (line 31) | type MouseButton =
  type RawKeyValue (line 185) | type RawKeyValue = typeof RawKey[keyof typeof RawKey];
  constant MODIFIERS (line 188) | const MODIFIERS = new Set<string>([
  class KeyEvent (line 199) | class KeyEvent {
    method constructor (line 204) | constructor(name: string) {
    method press (line 210) | press() {
    method isModifier (line 215) | isModifier(): boolean {
    method isNumpad (line 219) | isNumpad(): boolean {
    method isArrow (line 223) | isArrow(): boolean {
    method in (line 227) | in(set: string[]): boolean {

FILE: src/types/style.ts
  type Alignment (line 1) | type Alignment =
Condensed preview — 137 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (612K chars).
[
  {
    "path": ".github/FUNDING.yml",
    "chars": 19,
    "preview": "github: [mulaRahul]"
  },
  {
    "path": ".github/workflows/winget.yml",
    "chars": 266,
    "preview": "name: Publish to Winget\n\non:\n  release:\n    types: [published]\n\njobs:\n  publish:\n    runs-on: ubuntu-latest\n    steps:\n "
  },
  {
    "path": ".gitignore",
    "chars": 253,
    "preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndis"
  },
  {
    "path": ".vscode/extensions.json",
    "chars": 80,
    "preview": "{\n  \"recommendations\": [\"tauri-apps.tauri-vscode\", \"rust-lang.rust-analyzer\"]\n}\n"
  },
  {
    "path": "LICENSE",
    "chars": 35105,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "README.md",
    "chars": 3353,
    "preview": "# [Keyviz](https://keyviz.org)\n\n<div>\n   <img src=\"https://img.shields.io/github/v/release/mulaRahul/keyviz?style=flat-s"
  },
  {
    "path": "components.json",
    "chars": 500,
    "preview": "{\n  \"$schema\": \"https://ui.shadcn.com/schema.json\",\n  \"style\": \"base-nova\",\n  \"rsc\": false,\n  \"tsx\": true,\n  \"tailwind\":"
  },
  {
    "path": "index.html",
    "chars": 356,
    "preview": "<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <link rel=\"icon\" type=\"image/svg+xml\" href=\"/"
  },
  {
    "path": "package.json",
    "chars": 1670,
    "preview": "{\n  \"name\": \"keyviz\",\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"vite\",\n   "
  },
  {
    "path": "src/App.css",
    "chars": 4748,
    "preview": "@import \"tailwindcss\";\n@import \"tw-animate-css\";\n@import \"shadcn/tailwind.css\";\n@import \"@fontsource-variable/inter\";\n\n@"
  },
  {
    "path": "src/App.tsx",
    "chars": 792,
    "preview": "import \"./App.css\";\n\nimport { Suspense, lazy } from \"react\";\nimport { HashRouter, Route, Routes } from \"react-router-dom"
  },
  {
    "path": "src/components/custom-filter.tsx",
    "chars": 12567,
    "preview": "import { ToggleGroup, ToggleGroupItem } from \"@/components/ui/toggle-group\";\nimport { keymaps } from \"@/lib/keymaps\";\nim"
  },
  {
    "path": "src/components/key-overlay.tsx",
    "chars": 5851,
    "preview": "import { easeInQuint, easeOutQuint } from \"@/lib/utils\";\nimport { useKeyEvent } from \"@/stores/key_event\";\nimport { useK"
  },
  {
    "path": "src/components/keycaps/base.tsx",
    "chars": 2919,
    "preview": "import { keymaps } from \"@/lib/keymaps\";\nimport { useKeyStyle } from \"@/stores/key_style\";\nimport { KeyEvent } from \"@/t"
  },
  {
    "path": "src/components/keycaps/index.tsx",
    "chars": 714,
    "preview": "import { useKeyStyle } from \"@/stores/key_style\";\nimport { KeyEvent } from \"@/types/event\";\nimport { LowProfileKeycap } "
  },
  {
    "path": "src/components/keycaps/laptop.tsx",
    "chars": 2147,
    "preview": "import { darken, lighten } from \"@/lib/utils\";\nimport { useKeyStyle } from \"@/stores/key_style\";\nimport type { KeycapPro"
  },
  {
    "path": "src/components/keycaps/lowprofile.tsx",
    "chars": 2869,
    "preview": "import { easeInOutExpo } from \"@/lib/utils\";\nimport { useKeyStyle } from \"@/stores/key_style\";\nimport { motion } from \"m"
  },
  {
    "path": "src/components/keycaps/minimal.tsx",
    "chars": 1635,
    "preview": "import { keymaps } from \"@/lib/keymaps\";\nimport { easeInOutExpo } from \"@/lib/utils\";\nimport { useKeyStyle } from \"@/sto"
  },
  {
    "path": "src/components/keycaps/pbt.tsx",
    "chars": 2864,
    "preview": "import { darken, easeInOutExpo } from \"@/lib/utils\";\nimport { useKeyStyle } from \"@/stores/key_style\";\nimport { motion }"
  },
  {
    "path": "src/components/keycaps/press-count.tsx",
    "chars": 1335,
    "preview": "import { useKeyStyle } from \"@/stores/key_style\";\nimport { motion } from \"motion/react\";\n\n// bug: clips when background "
  },
  {
    "path": "src/components/mouse-indicator.tsx",
    "chars": 7588,
    "preview": "import { useKeyEvent } from \"@/stores/key_event\";\nimport { useKeyStyle } from \"@/stores/key_style\";\nimport { JSX } from "
  },
  {
    "path": "src/components/mouse-overlay.tsx",
    "chars": 5183,
    "preview": "import { easeInOutExpo } from \"@/lib/utils\";\nimport { useKeyEvent } from \"@/stores/key_event\";\nimport { useKeyStyle } fr"
  },
  {
    "path": "src/components/settings/about.tsx",
    "chars": 7171,
    "preview": "import { Button } from \"@/components/ui/button\"\nimport { Item, ItemActions, ItemContent, ItemDescription, ItemTitle } fr"
  },
  {
    "path": "src/components/settings/appearance.tsx",
    "chars": 9245,
    "preview": "import { useEffect, useState } from \"react\";\n\nimport { AlignmentSelector } from \"@/components/ui/alignment-selector\";\nim"
  },
  {
    "path": "src/components/settings/general.tsx",
    "chars": 6573,
    "preview": "import { invoke } from '@tauri-apps/api/core';\n\nimport { ShortcutRecorder } from '@/components/shortcut-recorder';\nimpor"
  },
  {
    "path": "src/components/settings/index.tsx",
    "chars": 216,
    "preview": "export { GeneralSettings } from \"./general\";\nexport { AppearanceSettings } from \"./appearance\";\nexport { KeycapSettings "
  },
  {
    "path": "src/components/settings/keycap.tsx",
    "chars": 28540,
    "preview": "import { AlignmentSelector } from \"@/components/ui/alignment-selector\";\nimport { Button } from \"@/components/ui/button\";"
  },
  {
    "path": "src/components/settings/mouse.tsx",
    "chars": 8288,
    "preview": "import { ColorInput } from \"@/components/ui/color-picker\";\nimport { Item, ItemActions, ItemContent, ItemDescription, Ite"
  },
  {
    "path": "src/components/shortcut-recorder.tsx",
    "chars": 4635,
    "preview": "import { keymaps } from '@/lib/keymaps';\nimport { RawKey } from '@/types/event';\nimport { useEffect, useRef, useState } "
  },
  {
    "path": "src/components/theme-mode-toggle.tsx",
    "chars": 1361,
    "preview": "import { useTheme } from \"@/components/theme-provider\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Dropdo"
  },
  {
    "path": "src/components/theme-provider.tsx",
    "chars": 1577,
    "preview": "import { createContext, useContext, useEffect, useState } from \"react\"\n\ntype Theme = \"dark\" | \"light\" | \"system\"\n\ntype T"
  },
  {
    "path": "src/components/ui/alert-dialog.tsx",
    "chars": 5126,
    "preview": "import * as React from \"react\"\nimport { AlertDialog as AlertDialogPrimitive } from \"@base-ui/react/alert-dialog\"\n\nimport"
  },
  {
    "path": "src/components/ui/alignment-selector.tsx",
    "chars": 2988,
    "preview": "import { cn } from \"@/lib/utils\";\nimport { Alignment } from \"@/types/style\";\nimport { ArrowDown02Icon, ArrowDownLeftIcon"
  },
  {
    "path": "src/components/ui/badge.tsx",
    "chars": 1903,
    "preview": "import { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { c"
  },
  {
    "path": "src/components/ui/button-group.tsx",
    "chars": 2552,
    "preview": "import { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { c"
  },
  {
    "path": "src/components/ui/button.tsx",
    "chars": 3093,
    "preview": "import { Button as ButtonPrimitive } from \"@base-ui/react/button\"\nimport { cva, type VariantProps } from \"class-variance"
  },
  {
    "path": "src/components/ui/card.tsx",
    "chars": 2556,
    "preview": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Card({\n  className,\n  size = \"default\",\n  ..."
  },
  {
    "path": "src/components/ui/collapsible.tsx",
    "chars": 644,
    "preview": "import { Collapsible as CollapsiblePrimitive } from \"@base-ui/react/collapsible\"\n\nfunction Collapsible({ ...props }: Col"
  },
  {
    "path": "src/components/ui/color-picker.tsx",
    "chars": 16812,
    "preview": "'use client';\n\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport { Pipette"
  },
  {
    "path": "src/components/ui/combobox.tsx",
    "chars": 9176,
    "preview": "\"use client\"\n\nimport * as React from \"react\"\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\"\n\nimport { cn"
  },
  {
    "path": "src/components/ui/command.tsx",
    "chars": 5028,
    "preview": "import * as React from \"react\"\nimport { Command as CommandPrimitive } from \"cmdk\"\n\nimport { cn } from \"@/lib/utils\"\nimpo"
  },
  {
    "path": "src/components/ui/dialog.tsx",
    "chars": 4055,
    "preview": "import * as React from \"react\"\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\"\n\nimport { cn } from \"@/"
  },
  {
    "path": "src/components/ui/drawer.tsx",
    "chars": 4358,
    "preview": "import * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunct"
  },
  {
    "path": "src/components/ui/dropdown-menu.tsx",
    "chars": 8850,
    "preview": "\"use client\"\n\nimport * as React from \"react\"\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\"\n\nimport { "
  },
  {
    "path": "src/components/ui/field.tsx",
    "chars": 5915,
    "preview": "import { useMemo } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@"
  },
  {
    "path": "src/components/ui/gradient-picker.tsx",
    "chars": 21560,
    "preview": "'use client';\n\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport {\n  Pipet"
  },
  {
    "path": "src/components/ui/icons.tsx",
    "chars": 3764,
    "preview": "import type { LucideProps } from \"lucide-react\";\nimport { forwardRef, type ReactNode } from \"react\";\n\n// Factory functio"
  },
  {
    "path": "src/components/ui/input-group.tsx",
    "chars": 5196,
    "preview": "\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport {"
  },
  {
    "path": "src/components/ui/input.tsx",
    "chars": 976,
    "preview": "import * as React from \"react\"\n\nimport { cn } from '@/lib/utils'\n\nfunction Input({ className, type, ...props }: React.Co"
  },
  {
    "path": "src/components/ui/item.tsx",
    "chars": 5222,
    "preview": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-"
  },
  {
    "path": "src/components/ui/label.tsx",
    "chars": 518,
    "preview": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Label({ className, ...props }: "
  },
  {
    "path": "src/components/ui/multi-select.tsx",
    "chars": 10186,
    "preview": "'use client';\nimport * as React from 'react';\nimport { CheckIcon, XCircle, ChevronDown, XIcon } from 'lucide-react';\n\nim"
  },
  {
    "path": "src/components/ui/number-input-buttons.tsx",
    "chars": 1689,
    "preview": "import { HugeiconsIcon } from \"@hugeicons/react\";\nimport { Button } from \"./button\";\nimport { ButtonGroup } from \"./butt"
  },
  {
    "path": "src/components/ui/number-input-scrub.tsx",
    "chars": 3897,
    "preview": "import React, { useState, useRef, useEffect, useCallback } from \"react\";\nimport { Input } from \"@/components/ui/input\";\n"
  },
  {
    "path": "src/components/ui/number-input.tsx",
    "chars": 1851,
    "preview": "import { ChevronDownIcon, ChevronUpIcon } from \"lucide-react\";\nimport { Button, Group, Input, NumberField, type NumberFi"
  },
  {
    "path": "src/components/ui/popover.tsx",
    "chars": 2375,
    "preview": "\"use client\"\n\nimport * as React from \"react\"\nimport { Popover as PopoverPrimitive } from \"radix-ui\"\n\nimport { cn } from "
  },
  {
    "path": "src/components/ui/scroll-area.tsx",
    "chars": 1579,
    "preview": "import { ScrollArea as ScrollAreaPrimitive } from \"@base-ui/react/scroll-area\"\n\nimport { cn } from \"@/lib/utils\"\n\nfuncti"
  },
  {
    "path": "src/components/ui/select.tsx",
    "chars": 6807,
    "preview": "\"use client\"\n\nimport * as React from \"react\"\nimport { Select as SelectPrimitive } from \"radix-ui\"\n\nimport { cn } from '@"
  },
  {
    "path": "src/components/ui/separator.tsx",
    "chars": 587,
    "preview": "import { Separator as SeparatorPrimitive } from \"@base-ui/react/separator\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction S"
  },
  {
    "path": "src/components/ui/sheet.tsx",
    "chars": 4448,
    "preview": "import * as React from \"react\"\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\"\n\nimport { cn } from \"@/l"
  },
  {
    "path": "src/components/ui/sidebar-item.tsx",
    "chars": 726,
    "preview": "import { cn } from \"@/lib/utils\";\nimport { HugeiconsIcon, IconSvgElement } from \"@hugeicons/react\";\n\nexport const Sideba"
  },
  {
    "path": "src/components/ui/skeleton.tsx",
    "chars": 275,
    "preview": "import { cn } from \"@/lib/utils\"\n\nfunction Skeleton({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n "
  },
  {
    "path": "src/components/ui/slider.tsx",
    "chars": 1918,
    "preview": "\"use client\"\n\nimport * as React from \"react\"\nimport { Slider as SliderPrimitive } from \"radix-ui\"\n\nimport { cn } from '@"
  },
  {
    "path": "src/components/ui/sonner.tsx",
    "chars": 1522,
    "preview": "import { useTheme } from \"next-themes\"\nimport { Toaster as Sonner, type ToasterProps } from \"sonner\"\nimport { HugeiconsI"
  },
  {
    "path": "src/components/ui/switch.tsx",
    "chars": 1701,
    "preview": "import { Switch as SwitchPrimitive } from \"@base-ui/react/switch\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Switch({\n "
  },
  {
    "path": "src/components/ui/tabs.tsx",
    "chars": 3660,
    "preview": "\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { "
  },
  {
    "path": "src/components/ui/textarea.tsx",
    "chars": 850,
    "preview": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Textarea({ className, ...props }: React.Compo"
  },
  {
    "path": "src/components/ui/toggle-group.tsx",
    "chars": 3627,
    "preview": "\"use client\"\n\nimport * as React from \"react\"\nimport { type VariantProps } from \"class-variance-authority\"\nimport { Toggl"
  },
  {
    "path": "src/components/ui/toggle.tsx",
    "chars": 1562,
    "preview": "\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { "
  },
  {
    "path": "src/components/ui/tooltip.tsx",
    "chars": 2418,
    "preview": "import { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Tooltip"
  },
  {
    "path": "src/lib/keymaps.ts",
    "chars": 12581,
    "preview": "import { platform } from \"@tauri-apps/plugin-os\";\nimport { MouseLeftClickIcon, MouseMiddleClickIcon, MouseRightClickIcon"
  },
  {
    "path": "src/lib/utils.ts",
    "chars": 678,
    "preview": "import { clsx, type ClassValue } from \"clsx\"\nimport { BezierDefinition } from \"motion/react\";\nimport { twMerge } from \"t"
  },
  {
    "path": "src/main.tsx",
    "chars": 229,
    "preview": "import React from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport App from \"./App\";\n\nReactDOM.createRoot(docume"
  },
  {
    "path": "src/pages/settings.tsx",
    "chars": 2697,
    "preview": "import { useState } from \"react\";\n\nimport { AboutPage, AppearanceSettings, GeneralSettings, KeycapSettings, MouseSetting"
  },
  {
    "path": "src/pages/visualization.tsx",
    "chars": 2271,
    "preview": "import { KeyOverlay } from \"@/components/key-overlay\";\nimport { MouseOverlay } from \"@/components/mouse-overlay\";\nimport"
  },
  {
    "path": "src/stores/key_event.ts",
    "chars": 15014,
    "preview": "import { EventPayload, KeyEvent, MappedKeys, MODIFIERS, MouseButton, MouseButtonEvent, MouseMoveEvent, MouseWheelEvent, "
  },
  {
    "path": "src/stores/key_style.ts",
    "chars": 8110,
    "preview": "import { Alignment } from \"@/types/style\";\nimport { createJSONStorage, persist } from \"zustand/middleware\";\nimport { tau"
  },
  {
    "path": "src/stores/storage.ts",
    "chars": 894,
    "preview": "import { getCurrentWindow } from '@tauri-apps/api/window';\nimport { load } from '@tauri-apps/plugin-store';\nimport { Sta"
  },
  {
    "path": "src/stores/sync.ts",
    "chars": 4545,
    "preview": "import { emit, listen, UnlistenFn } from '@tauri-apps/api/event';\nimport { create, StateCreator, StoreApi, UseBoundStore"
  },
  {
    "path": "src/types/event.ts",
    "chars": 4318,
    "preview": "export type EventPayload =\n  | RawKeyEvent\n  | MouseButtonEvent\n  | MouseMoveEvent\n  | MouseWheelEvent;\n\nexport interfac"
  },
  {
    "path": "src/types/style.ts",
    "chars": 1745,
    "preview": "export type Alignment =\n    | 'top-left' | 'top-center' | 'top-right'\n    | 'center-left' | 'center' | 'center-right'\n  "
  },
  {
    "path": "src/vite-env.d.ts",
    "chars": 38,
    "preview": "/// <reference types=\"vite/client\" />\n"
  },
  {
    "path": "src-tauri/.gitignore",
    "chars": 166,
    "preview": "# Generated by Cargo\n# will have compiled files and executables\n/target/\n\n# Generated by Tauri\n# will have schema files "
  },
  {
    "path": "src-tauri/2",
    "chars": 226,
    "preview": "\nadded 1 package, and audited 782 packages in 3s\n\n124 packages are looking for funding\n  run `npm fund` for details\n\n2 v"
  },
  {
    "path": "src-tauri/Cargo.toml",
    "chars": 1259,
    "preview": "[package]\nname = \"keyviz\"\nversion = \"0.1.0\"\ndescription = \"A Tauri App\"\nauthors = [\"you\"]\nedition = \"2021\"\n\n# See more k"
  },
  {
    "path": "src-tauri/build.rs",
    "chars": 39,
    "preview": "fn main() {\n    tauri_build::build()\n}\n"
  },
  {
    "path": "src-tauri/capabilities/default.json",
    "chars": 616,
    "preview": "{\n  \"$schema\": \"../gen/schemas/desktop-schema.json\",\n  \"identifier\": \"default\",\n  \"description\": \"Capability for the mai"
  },
  {
    "path": "src-tauri/crates/rdev/.gitignore",
    "chars": 19,
    "preview": "/target\nCargo.lock\n"
  },
  {
    "path": "src-tauri/crates/rdev/Cargo.toml",
    "chars": 2150,
    "preview": "[package]\nauthors = [\"Nicolas Patry <patry.nicolas@protonmail.com>\"]\nedition = \"2018\"\nname = \"rdev\"\nversion = \"0.5.0-2\"\n"
  },
  {
    "path": "src-tauri/crates/rdev/LICENSE",
    "chars": 1070,
    "preview": "MIT License\n\nCopyright (c) 2020 Nicolas Patry\n\nPermission is hereby granted, free of charge, to any person obtaining a c"
  },
  {
    "path": "src-tauri/crates/rdev/README.md",
    "chars": 7831,
    "preview": "![](https://github.com/Narsil/rdev/workflows/build/badge.svg)\n[![Crate](https://img.shields.io/crates/v/rdev.svg)](https"
  },
  {
    "path": "src-tauri/crates/rdev/rustfmt.toml",
    "chars": 16,
    "preview": "edition = \"2018\""
  },
  {
    "path": "src-tauri/crates/rdev/src/codes_conv.rs",
    "chars": 6045,
    "preview": "#[cfg(target_os = \"linux\")]\nuse crate::keycodes::linux::key_from_code as linux_key_from_code;\n#[cfg(target_os = \"macos\")"
  },
  {
    "path": "src-tauri/crates/rdev/src/keycodes/android.rs",
    "chars": 2538,
    "preview": "use crate::rdev::Key;\n\nmacro_rules! decl_keycodes {\n    ($($key:ident, $code:literal),*) => {\n        //TODO: make const"
  },
  {
    "path": "src-tauri/crates/rdev/src/keycodes/chrome.rs",
    "chars": 5215,
    "preview": "use crate::rdev::Key;\n\npub const RESERVED_UNKNOWN_CODE: u32 = 0;\n\nmacro_rules! decl_keycodes {\n    ($($key:ident, $code:"
  },
  {
    "path": "src-tauri/crates/rdev/src/keycodes/linux.rs",
    "chars": 3221,
    "preview": "use crate::rdev::Key;\n\nmacro_rules! decl_keycodes {\n    ($($key:ident, $code:literal),*) => {\n        //TODO: make const"
  },
  {
    "path": "src-tauri/crates/rdev/src/keycodes/macos.rs",
    "chars": 4506,
    "preview": "#![allow(non_upper_case_globals)]\n\nuse super::macos_virtual_keycodes::*;\nuse crate::rdev::Key;\n\npub use super::macos_vir"
  },
  {
    "path": "src-tauri/crates/rdev/src/keycodes/macos_virtual_keycodes.rs",
    "chars": 5080,
    "preview": "// keycodes from #include <Carbon/Carbon.h>\n#![allow(non_upper_case_globals)]\n#![allow(dead_code)]\n\n#[cfg(not(target_os "
  },
  {
    "path": "src-tauri/crates/rdev/src/keycodes/mod.rs",
    "chars": 129,
    "preview": "pub mod usb_hid;\npub mod windows;\npub mod linux;\npub mod macos;\npub mod macos_virtual_keycodes;\npub mod android;\npub mod"
  },
  {
    "path": "src-tauri/crates/rdev/src/keycodes/usb_hid.rs",
    "chars": 4091,
    "preview": "use crate::rdev::Key;\n\nmacro_rules! decl_keycodes {\n    ($($key:ident, $code:literal),*) => {\n        pub fn code_from_k"
  },
  {
    "path": "src-tauri/crates/rdev/src/keycodes/windows.rs",
    "chars": 6614,
    "preview": "use crate::rdev::Key;\n\nmacro_rules! decl_keycodes {\n    ($($key:ident, $code:literal, $scancode:literal),*) => {\n       "
  },
  {
    "path": "src-tauri/crates/rdev/src/lib.rs",
    "chars": 17150,
    "preview": "//! Simple library to listen and send events to keyboard and mouse on MacOS, Windows and Linux\n//! (x11).\n//!\n//! You ca"
  },
  {
    "path": "src-tauri/crates/rdev/src/linux/common.rs",
    "chars": 4111,
    "preview": "use crate::linux::keyboard::Keyboard;\nuse crate::keycodes::linux::key_from_code;\nuse crate::rdev::{Button, Event, EventT"
  },
  {
    "path": "src-tauri/crates/rdev/src/linux/display.rs",
    "chars": 249,
    "preview": "use crate::linux::common::Display;\nuse crate::rdev::DisplayError;\n\npub fn display_size() -> Result<(u64, u64), DisplayEr"
  },
  {
    "path": "src-tauri/crates/rdev/src/linux/grab.rs",
    "chars": 10923,
    "preview": "use crate::rdev::UnicodeInfo;\n// This code is awful. Good luck\nuse crate::{key_from_code, Event, EventType, GrabError, K"
  },
  {
    "path": "src-tauri/crates/rdev/src/linux/keyboard.rs",
    "chars": 10469,
    "preview": "extern crate x11;\nuse crate::keycodes::linux::code_from_key;\nuse crate::rdev::{EventType, KeyboardState, UnicodeInfo};\nu"
  },
  {
    "path": "src-tauri/crates/rdev/src/linux/listen.rs",
    "chars": 3749,
    "preview": "extern crate libc;\nextern crate x11;\nuse crate::linux::common::{convert, FALSE, KEYBOARD};\nuse crate::linux::keyboard::K"
  },
  {
    "path": "src-tauri/crates/rdev/src/linux/mod.rs",
    "chars": 429,
    "preview": "extern crate libc;\nextern crate x11;\n\nmod common;\nmod display;\nmod grab;\nmod keyboard;\nmod listen;\nmod simulate;\n\npub us"
  },
  {
    "path": "src-tauri/crates/rdev/src/linux/simulate.rs",
    "chars": 5231,
    "preview": "use crate::linux::common::{FALSE, TRUE};\nuse crate::keycodes::linux::code_from_key;\nuse crate::rdev::{Button, EventType,"
  },
  {
    "path": "src-tauri/crates/rdev/src/macos/common.rs",
    "chars": 10706,
    "preview": "#![allow(clippy::upper_case_acronyms)]\nuse crate::keycodes::macos::virtual_keycodes::*;\nuse crate::macos::keyboard::Keyb"
  },
  {
    "path": "src-tauri/crates/rdev/src/macos/display.rs",
    "chars": 216,
    "preview": "use crate::rdev::DisplayError;\nuse core_graphics::display::CGDisplay;\n\npub fn display_size() -> Result<(u64, u64), Displ"
  },
  {
    "path": "src-tauri/crates/rdev/src/macos/grab.rs",
    "chars": 2421,
    "preview": "#![allow(improper_ctypes_definitions)]\nuse crate::macos::common::*;\nuse crate::rdev::{Event, GrabError};\nuse cocoa::base"
  },
  {
    "path": "src-tauri/crates/rdev/src/macos/keyboard.rs",
    "chars": 9587,
    "preview": "#![allow(clippy::upper_case_acronyms)]\nuse crate::keycodes::macos::code_from_key;\nuse crate::rdev::{EventType, Key, Keyb"
  },
  {
    "path": "src-tauri/crates/rdev/src/macos/listen.rs",
    "chars": 2182,
    "preview": "#![allow(improper_ctypes_definitions)]\nuse crate::macos::common::*;\nuse crate::rdev::{Event, ListenError};\nuse cocoa::ba"
  },
  {
    "path": "src-tauri/crates/rdev/src/macos/mod.rs",
    "chars": 437,
    "preview": "mod common;\nmod display;\nmod grab;\nmod keyboard;\nmod listen;\nmod simulate;\n\npub use crate::macos::common::{map_keycode, "
  },
  {
    "path": "src-tauri/crates/rdev/src/macos/simulate.rs",
    "chars": 7517,
    "preview": "use crate::keycodes::macos::{code_from_key, virtual_keycodes::*};\nuse crate::macos::common::CGEventSourceKeyState;\nuse c"
  },
  {
    "path": "src-tauri/crates/rdev/src/rdev.rs",
    "chars": 9637,
    "preview": "#[cfg(feature = \"serialize\")]\nuse serde::{Deserialize, Serialize};\nuse std::time::SystemTime;\nuse std::{fmt, fmt::Displa"
  },
  {
    "path": "src-tauri/crates/rdev/src/windows/common.rs",
    "chars": 6303,
    "preview": "use crate::rdev::{Button, EventType, Key};\nuse crate::windows::keyboard::Keyboard;\nuse crate::keycodes::windows::key_fro"
  },
  {
    "path": "src-tauri/crates/rdev/src/windows/display.rs",
    "chars": 501,
    "preview": "use crate::rdev::DisplayError;\nuse std::convert::TryInto;\nuse winapi::um::winuser::{GetSystemMetrics, SM_CXSCREEN, SM_CY"
  },
  {
    "path": "src-tauri/crates/rdev/src/windows/grab.rs",
    "chars": 7130,
    "preview": "use crate::{\n    rdev::{Event, EventType, GrabError},\n    windows::common::{convert, get_scan_code, HookError, KEYBOARD}"
  },
  {
    "path": "src-tauri/crates/rdev/src/windows/keyboard.rs",
    "chars": 13956,
    "preview": "use crate::rdev::{EventType, Key, KeyboardState, UnicodeInfo};\nuse crate::windows::common::{get_code, get_scan_code, FAL"
  },
  {
    "path": "src-tauri/crates/rdev/src/windows/listen.rs",
    "chars": 2313,
    "preview": "use crate::{\n    rdev::{Event, ListenError},\n    windows::common::{convert, get_scan_code, set_key_hook, set_mouse_hook,"
  },
  {
    "path": "src-tauri/crates/rdev/src/windows/mod.rs",
    "chars": 401,
    "preview": "extern crate winapi;\n\nmod common;\nmod display;\nmod grab;\nmod keyboard;\nmod listen;\nmod simulate;\n\n\npub use crate::window"
  },
  {
    "path": "src-tauri/crates/rdev/src/windows/simulate.rs",
    "chars": 9636,
    "preview": "use crate::rdev::{Button, EventType, RawKey, SimulateError};\nuse crate::keycodes::windows::{get_win_codes, scancode_from"
  },
  {
    "path": "src-tauri/src/app/commands.rs",
    "chars": 1747,
    "preview": "use std::sync::Mutex;\n\nuse tauri::{Manager, PhysicalPosition, PhysicalSize};\n\nuse crate::app::state::AppState;\n\n#[tauri:"
  },
  {
    "path": "src-tauri/src/app/event.rs",
    "chars": 5115,
    "preview": "use std::{sync::Mutex, thread};\n\nuse rdev::{listen, Button, EventType};\nuse serde::Serialize;\nuse tauri::{menu::MenuItem"
  },
  {
    "path": "src-tauri/src/app/mod.rs",
    "chars": 64,
    "preview": "pub mod commands;\npub mod event;\npub mod state;\npub mod window;\n"
  },
  {
    "path": "src-tauri/src/app/state.rs",
    "chars": 2756,
    "preview": "use serde::Deserialize;\nuse tauri::{image::Image, include_image, Emitter, Wry};\nuse tauri_plugin_store::StoreExt;\n\n#[der"
  },
  {
    "path": "src-tauri/src/app/window.rs",
    "chars": 1623,
    "preview": "pub fn config_window(window: &tauri::WebviewWindow) {\n    window\n        .set_ignore_cursor_events(true)\n        .expect"
  },
  {
    "path": "src-tauri/src/lib.rs",
    "chars": 3943,
    "preview": "use std::sync::Mutex;\n\nuse tauri::{\n    image::Image,\n    include_image,\n    menu::{Menu, MenuItem},\n    tray::TrayIconB"
  },
  {
    "path": "src-tauri/src/main.rs",
    "chars": 181,
    "preview": "// Prevents additional console window on Windows in release, DO NOT REMOVE!!\n#![cfg_attr(not(debug_assertions), windows_"
  },
  {
    "path": "src-tauri/tauri.conf.json",
    "chars": 906,
    "preview": "{\n  \"$schema\": \"https://schema.tauri.app/config/2\",\n  \"productName\": \"keyviz\",\n  \"version\": \"2.1.0\",\n  \"identifier\": \"or"
  },
  {
    "path": "src-tauri/tauri.windows.conf.json",
    "chars": 714,
    "preview": "{\n    \"app\": {\n        \"windows\": [\n            {\n                \"label\": \"main\",\n                \"title\": \"Keyviz\",\n  "
  },
  {
    "path": "tsconfig.json",
    "chars": 688,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2020\",\n    \"useDefineForClassFields\": true,\n    \"lib\": [\"ES2020\", \"DOM\", \"DOM."
  },
  {
    "path": "tsconfig.node.json",
    "chars": 213,
    "preview": "{\n  \"compilerOptions\": {\n    \"composite\": true,\n    \"skipLibCheck\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\""
  },
  {
    "path": "vite.config.ts",
    "chars": 986,
    "preview": "import path from \"path\";\nimport { defineConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react\";\nimport tailwindc"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the mulaRahul/keyviz GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 137 files (566.9 KB), approximately 149.7k tokens, and a symbol index with 639 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!