pax_global_header 0000666 0000000 0000000 00000000064 15226114475 0014521 g ustar 00root root 0000000 0000000 52 comment=f3b142bd5fa4c0df4d8dd2001c42b51a97edde99
C0rn3j-sc-controller-f3b142b/ 0000775 0000000 0000000 00000000000 15226114475 0015751 5 ustar 00root root 0000000 0000000 C0rn3j-sc-controller-f3b142b/.dockerignore 0000664 0000000 0000000 00000000130 15226114475 0020417 0 ustar 00root root 0000000 0000000 # In case we were about to copy dist files from existing local builds, remove them
dist
C0rn3j-sc-controller-f3b142b/.github/ 0000775 0000000 0000000 00000000000 15226114475 0017311 5 ustar 00root root 0000000 0000000 C0rn3j-sc-controller-f3b142b/.github/dependabot.yml 0000664 0000000 0000000 00000000166 15226114475 0022144 0 ustar 00root root 0000000 0000000 version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
C0rn3j-sc-controller-f3b142b/.github/workflows/ 0000775 0000000 0000000 00000000000 15226114475 0021346 5 ustar 00root root 0000000 0000000 C0rn3j-sc-controller-f3b142b/.github/workflows/appimage.yml 0000664 0000000 0000000 00000012653 15226114475 0023663 0 ustar 00root root 0000000 0000000 name: Build and publish AppImages
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- platform: linux/amd64
arch: amd64
- platform: linux/arm64
arch: arm64
base:
- os: ubuntu
codename: noble
pubkey: 871920D1991BC93C
recipe: AppImageBuilder.yml
- os: ubuntu
codename: resolute
pubkey: 871920D1991BC93C
recipe: AppImageBuilder.yml
- os: debian
codename: bookworm
pubkey: 54404762BBB6E853
pubkey_security: 6ED0E7B82643E131
recipe: AppImageBuilder.debian.yml
- os: debian
codename: trixie
pubkey: BDE6D2B9216EC7A8
pubkey_security: 8E9F831205B4BA95
pubkey_updates: 78DBA3BC47EF2265
recipe: AppImageBuilder.debian.yml
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: rlespinasse/github-slug-action@v5
- name: Setup qemu for docker
uses: docker/setup-qemu-action@v4
if: matrix.target.platform != 'linux/amd64'
- name: Setup buildx for docker
uses: docker/setup-buildx-action@v4
- name: Compile in docker
uses: docker/build-push-action@v7
with:
context: .
platforms: ${{ matrix.target.platform }}
outputs: build
build-args: |
BASE_OS=${{ matrix.base.os }}
BASE_CODENAME=${{ matrix.base.codename }}
- name: Prepare environment to build AppImage
env:
TARGET_PLATFORM: ${{ matrix.target.platform }}
shell: bash
run: |
set -eua
if [ -r build/.build-metadata.env ]; then
. build/.build-metadata.env
rm build/.build-metadata.env
fi
APPIMAGE_SOURCE=build
APPIMAGE_VERSION="${VERSION}-${{ matrix.base.codename }}"
APPIMAGE_APT_ARCH="${TARGETARCH}"
APPIMAGE_APT_DISTRO="${{ matrix.base.codename }}"
APPIMAGE_APT_PUBKEY="${{ matrix.base.pubkey }}"
APPIMAGE_APT_PUBKEY_UPDATES="${{ matrix.base.pubkey_updates }}"
APPIMAGE_APT_PUBKEY_SECURITY="${{ matrix.base.pubkey_security }}"
APPIMAGE_ARCH="${TARGETMACHINE}"
printenv | grep ^APPIMAGE_ >>"${GITHUB_ENV}"
- name: Build AppImage
uses: C0rn3j/build-appimage@v1.3
with:
command: ${{
format('sh -c "set -eu; {0}; {1}; {2}; appimage-builder --recipe {3}"',
'pip install --upgrade setuptools packaging packaging-legacy',
'pip install --extra-index-url https://lief.s3-website.fr-par.scw.cloud/latest \"lief>=0.16.0.dev0\"',
'find /usr/local/lib -name package.py | while read -r file; do sed -i -e \"s/^from.packaging/&_legacy/\" \"${file}\"; done',
matrix.base.recipe)
}}
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: appimage-${{ matrix.base.codename }}-${{ matrix.target.arch }}
path: |
./*.AppImage
./*.AppImage.zsync
if-no-files-found: error
test:
runs-on: ${{ matrix.target.os }}
needs:
- build
strategy:
fail-fast: false
matrix:
target:
- platform: linux/amd64
arch: amd64
os: ubuntu-latest
# arm64 AppImages created by appimage-builder <= v1.1.0 are broken
# and fail with `APPRUN_ERROR: No such file or directory` on amd64
# due to https://github.com/AppImageCrafters/appimage-builder/issues/272
#
# This comment can be removed when a fixed appimage-builder release is available.
#- platform: linux/arm64
# arch: arm64
# os: ubuntu-24.04-arm
base:
- os: ubuntu
codename: noble
- os: ubuntu
codename: resolute
- os: debian
codename: bookworm
- os: debian
codename: trixie
- os: fedora
codename: "43"
- os: fedora
codename: "44"
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Download artifacts
uses: actions/download-artifact@v8
with:
pattern: appimage-*-${{ matrix.target.arch }}
path: appimages
merge-multiple: true
- name: Setup buildx for docker
uses: docker/setup-buildx-action@v4
- name: Test AppImages
uses: docker/build-push-action@v7
with:
file: AppImageBuilder.test.Dockerfile
context: appimages
platforms: ${{ matrix.target.platform }}
build-args: |
BASE_OS=${{ matrix.base.os }}
BASE_CODENAME=${{ matrix.base.codename }}
release:
runs-on: ubuntu-latest
needs:
- build
- test
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
pattern: appimage-*
path: assets
merge-multiple: true
- name: Upload artifacts to GitHub release
uses: softprops/action-gh-release@v3
with:
draft: ${{ !startsWith(github.ref, 'refs/tags/') }}
files: assets/*
C0rn3j-sc-controller-f3b142b/.github/workflows/scc-linux.yml 0000664 0000000 0000000 00000001223 15226114475 0023774 0 ustar 00root root 0000000 0000000 name: SCC Linux CI
on:
push:
branches:
- main
- master
- python3
pull_request:
branches:
- main
- master
- python3
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install dependencies
run: pip install build evdev setuptools ioctl-opt libusb1 vdf pytest
- name: Build SCC
run: python -m build
- name: Install SCC
run: python -m pip install dist/*.whl
- name: Run tests
run: python -m pytest tests
C0rn3j-sc-controller-f3b142b/.gitignore 0000664 0000000 0000000 00000000325 15226114475 0017741 0 ustar 00root root 0000000 0000000 *.pyc
.*
*~
*.so
*.patch
!scc/*tester*
test.*
test[0-9].*
build/
build-output/
venv/
.atomignore
commit*
profiles
.idea/
out.svg
*.AppImage
appimage/
*.cpp
*.vdf
.kateconfig
dist/
sccontroller.egg-info/
!.github
C0rn3j-sc-controller-f3b142b/ADDITIONAL-LICENSES 0000664 0000000 0000000 00000001366 15226114475 0020515 0 ustar 00root root 0000000 0000000 All images in images/ directory, profile files in default_profiles/
and profile_examples/ and menu files in default_menus/ directories
are licensed under the CC0 license - https://creativecommons.org/publicdomain/zero/1.0/
Images in images/menu-icons subdirectories are licensed as described
in the 'LICENSES' files in their respective subdirectories.
lib/jsonencoder.py is licensed under the PSFL, https://www.python.org/download/releases/2.7/license/
scripts/gamecontrollerdb.txt is taken from the Simple DirectMedia Layer library and licensed under the zlib license.
lib/xwrappers.py and lib/vdf.py are part of SC Controller, licensed under GPL2 like the rest of the project.
Everything else is licensed under GPL2, as described in the 'LICENSE' file.
C0rn3j-sc-controller-f3b142b/AppImageBuilder.debian.yml 0000664 0000000 0000000 00000020522 15226114475 0022710 0 ustar 00root root 0000000 0000000 version: 1
script:
- |
set -eu
if [ "{{APPIMAGE_SOURCE}}" != "${TARGET_APPDIR}" ]; then
mv "{{APPIMAGE_SOURCE}}" "${TARGET_APPDIR}"
fi
# Manual installation of squashfs-tools is required
# until https://github.com/AppImageCrafters/build-appimage/issues/5 is fixed
if ! command -v mksquashfs >/dev/null; then
apt-get update && apt-get install -y --no-install-recommends squashfs-tools
fi
AppDir:
app_info:
id: org.c0rn3j.sc-controller
name: sc-controller
version: "{{APPIMAGE_VERSION}}"
icon: sc-controller
exec: usr/bin/python3
exec_args: -c "import os, sys; os.execvp('$APPDIR/usr/bin/scc', ['$APPDIR/usr/bin/scc'] + (sys.argv[1:] if len(sys.argv) > 1 else ['gui']))" $@
after_bundle: |
set -eu
# install python3-ioctl-opt manually as it is not packaged anywhere
pip install --target "${TARGET_APPDIR}/usr/lib/python3/dist-packages/" ioctl-opt
# appimage-builder expects .desktop file to start with appinfo-id
desktop="$(find "${TARGET_APPDIR}/usr" -name sc-controller.desktop)"
sed -i "s:Exec=.*:Exec=./usr/bin/scc gui:g" "${desktop}"
ln -sr "${desktop}" "${TARGET_APPDIR}/usr/share/applications/org.c0rn3j.sc-controller.desktop"
# appimage-builder expects utf-8 encoding when patching shebangs,
# but pygettext3 has iso-8859-1 encoding
find "${TARGET_APPDIR}/usr/bin" -name 'pygettext*' | while read -r file; do
encoding="ISO-8859-1"
if file -bi "${file}" | grep -iq "${encoding}"; then
<"${file}" iconv -f "${encoding}" -t utf-8 -o "${file}"
sed -i -E '1,2 s|^(\s*#.*coding[=:]\s*)([[:alnum:].-]+)|\1utf-8|g' "${file}"
fi
done
# remove unused icons
icons="${TARGET_APPDIR}/usr/share/icons"
keep=$(
# Subset of: `wget -q https://specifications.freedesktop.org/icon-naming-spec/latest -O- | sed -nE 's:.*
([^<]+).*:\1:p' | sort`
printf '%s\n' index.theme close- edit- go- list- pan- window-
grep -rhoP '"icon_name">\K[^<]+(?=<)' glade
grep -rhoP 'icon_name *= *"\K[^"]+(?=")' scc
)
map_item() { echo "${1}" | while read -r item; do printf -- "${2}" "${item}"; done; }
paths=$(find "${icons}" '(' -false $(map_item "${keep}" ' -o -name %s*') ')' -print -type l -printf '%h/%l\n' | sort | uniq)
find "${icons}" \( -type d -empty -or -not -type d $(map_item "${paths}" ' -not -samefile %s') \) -delete
cancel() { echo >&2 "ERROR: ${@}" && return 1; }
if find "${icons}" -xtype l | grep .; then
cancel 'The symlinks shown above are broken.'
fi
if echo "${keep}" | while read -r icon; do echo "${paths}" | grep -q "${icon}[^/]*$" || echo "${icon}"; done | grep .; then
cancel 'The icons above are missing.'
fi
# Enable icon theme
xdg_settings="${TARGET_APPDIR}/etc/xdg/gtk-3.0/settings.ini"
if [ ! -e "${xdg_settings}" ]; then
mkdir -p "$(dirname "${xdg_settings}")"
theme=$(find "${icons}" -mindepth 1 -maxdepth 1 -type d -printf %f -quit)
printf '[Settings]\ngtk-icon-theme-name = %s\n' "${theme}" >"${xdg_settings}"
fi
# python3-usb1 expects 'libusb-1.0.so', see https://github.com/vpelletier/python-libusb1/issues/78
find "${TARGET_APPDIR}" -name 'libusb-1.0.so.[0-9]' | while read -r file; do
path="$(dirname "${file}")"
link="${file%.[0-9]}"
[ -e "${link}" ] || ln -sr "${file}" "${link}"
done
after_runtime: |
set -eu
# python3 is linked against 'lib64/ld-linux-x86-64.so.2' but 'compat/lib64' is missing
compat="${TARGET_APPDIR}/runtime/compat"
if [ ! -e "${compat}/lib64" ] && [ -d "${compat}/usr/lib64" ]; then
ln -s "usr/lib64" "${compat}/"
fi
apt:
arch:
- "{{APPIMAGE_APT_ARCH}}"
sources:
- sourceline: deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ {{APPIMAGE_APT_DISTRO}} main universe
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x{{APPIMAGE_APT_PUBKEY}}
- sourceline: deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ {{APPIMAGE_APT_DISTRO}}-updates main universe
- sourceline: deb [arch=amd64] http://security.ubuntu.com/ubuntu/ {{APPIMAGE_APT_DISTRO}}-security main universe
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ {{APPIMAGE_APT_DISTRO}} main universe
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ {{APPIMAGE_APT_DISTRO}}-updates main universe
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ {{APPIMAGE_APT_DISTRO}}-security main universe
include:
- gir1.2-gtk-3.0
- gir1.2-rsvg-2.0
- libbluetooth3
- libgtk-3-0
- libgtk-layer-shell-dev
- gir1.2-gtklayershell-0.1
- gir1.2-ayatanaappindicator3-0.1
- libdbusmenu-glib4
- libdbusmenu-gtk3-4
- librsvg2-common
- libwayland-client0
- libwayland-cursor0
- libwayland-egl1
- python-is-python3
- python3-evdev
- python3-gi-cairo
- python3-pylibacl
- python3-usb1
- python3-vdf
- binutils # required for detection of bluetooth library
- coreutils # provides /usr/bin/env
- paper-icon-theme # required for icons
- shared-mime-info # required for gui if host provides no MIME info, e.g. when XDG_DATA_DIRS is missing
exclude:
# coreutils
- libgmp* # arithmetics
# gir1.2-rsvg-2.0
# NOTE: libicu* and libxml* are intentionally NOT excluded. The bundled
# librsvg needs libxml2 (which pulls in icu), and minimal hosts such as
# SteamOS do not provide them, so excluding them gives a fatal
# "libxml2.so.2: cannot open shared object file" at GUI startup. Bundling
# them matches what the older appimage-build.sh shipped.
- libstdc* # development
# libgtk3-0
- "*-icon-theme" # gui
- "*crypt*" # security
- "*dconf*" # gui configuration
- "libdbus-1*" # process communication (keep libdbusmenu for the tray icon)
- "*gcc*" # development
- "*systemd*" # linux core
- libblk* # filesystem
- libcolord* # gui
- libcups* # printing
- libepoxy* # gui
- libfontconfig* # fonts
- libfreetype* # fonts
- libfribidi* # i18n
- libgtk-3-common # gui
- liblz* # codec
- libtiff* # codec
- libwebp* # codec
# python3
- "*krb*" # security
- "*readline*" # terminal
- "*sqlite*" # database
- libbz* # codec
- libdb* # database
- libmpdec* # arithmetics
- libncurses* # terminal
- libnsl* # network
- libssl* # security
- libtirpc* # development
- libuuid* # development
- media-types # codec
# Ubuntu Noble
- libgprofng* # development
- libjansson* # codec
- libsframe* # development
- netbase # network
- tzdata # date/time
files:
exclude:
- usr/bin/*gold* # alternative for ld
- usr/bin/*gp-display-html* # requires perl
- usr/lib/*/gconv # unicode
- usr/lib/*/gdk-pixbuf-2.0/*/loaders/libpixbufloader-??[!g]*.so # only png & svg are required
- usr/lib/*/glib-2.0
- usr/lib/python*/cgi.py
- usr/lib/python*/test
- usr/lib/python*/unittest
- usr/share/doc
- usr/share/glib-2.0
- usr/share/gtk-doc
- usr/share/icu
- usr/share/locale
- usr/share/man
- usr/share/python3/runtime.d
- usr/share/thumbnailers
runtime:
env:
# `usr/lib/python3.*/site-packages` is required in $PYTHONPATH,
# but the python version and hence the actual location is unknown here.
# Fortunately the site-packages directory is on the $PATH, so we add $PATH instead.
# It must precede an existing $PYTHONPATH to work.
PYTHONPATH: "${APPDIR}/usr/lib/python3/dist-packages:${PATH}:${PYTHONPATH}"
SCC_SHARED: "${APPDIR}/usr/share/scc"
AppImage:
arch: "{{APPIMAGE_ARCH}}"
update-information: "gh-releases-zsync|C0rn3j|sc-controller|latest|sc-controller-*-{{APPIMAGE_APT_DISTRO}}-{{APPIMAGE_ARCH}}.AppImage.zsync"
C0rn3j-sc-controller-f3b142b/Dockerfile 0000664 0000000 0000000 00000005151 15226114475 0017745 0 ustar 00root root 0000000 0000000 # syntax=docker/dockerfile:1
ARG BASE_OS=ubuntu
ARG BASE_CODENAME=noble
FROM $BASE_OS:$BASE_CODENAME AS build-stage
# Download build dependencies
RUN <>/build/.build-metadata.env
# Fix shebangs of scripts from '#!/work/.env/bin/python' - note that AppImage builder will strip the leading /
find "${TARGET}/usr/bin" -type f | xargs sed -i 's:work/.env/bin/:usr/bin/env :'
# Provide input-event-codes.h as fallback for runtime systems without linux headers
cp -a \
"$(find /usr -type f -name input-event-codes.h -print -quit)" \
"$(find "${TARGET}" -type f -name uinput.py -printf '%h\n' -quit)"
# Create short name symlinks for static libraries
suffix=".cpython-*-$(uname -m)-linux-gnu.so"
find "${TARGET}" -type f -path "*/site-packages/*${suffix}" \
| while read -r path; do ln -sfr "${path}" "${path%${suffix}}.so"; done
share="${TARGET}/usr/share"
# Put AppStream metadata to required location according to https://wiki.debian.org/AppStream/Guidelines
metainfo="${share}/metainfo"
mkdir -p "${metainfo}"
cp -a scripts/sc-controller.appdata.xml "${metainfo}"
# Convert icon to png format (required for icons in .desktop file)
iconpath="${share}/icons/hicolor/512x512/apps"
mkdir -p "${iconpath}"
rsvg-convert --background-color none -o "${iconpath}/sc-controller.png" images/sc-controller.svg
EOR
# Store build metadata
ARG TARGETOS TARGETARCH TARGETVARIANT
RUN export "TARGETMACHINE=$(uname -m)" && printenv | grep ^TARGET >>/build/.build-metadata.env
# Keep only files required for runtime
FROM scratch AS export-stage
COPY --from=build-stage /build /
C0rn3j-sc-controller-f3b142b/LICENSE 0000664 0000000 0000000 00000035562 15226114475 0016771 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. 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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.
END OF TERMS AND CONDITIONS
C0rn3j-sc-controller-f3b142b/README.md 0000664 0000000 0000000 00000013042 15226114475 0017230 0 ustar 00root root 0000000 0000000 # SC Controller
[](https://github.com/C0rn3j/sc-controller/actions/workflows/scc-linux.yml)
[](https://github.com/C0rn3j/sc-controller/actions/workflows/appimage.yml)
User-mode driver, mapper and GTK3 based GUI for Steam Controller, DS4 and many other controllers.
[](docs/screenshot1.png?raw=true)
[](docs/screenshot2.png?raw=true)
[](docs/screenshot3.png?raw=true)
[](docs/screenshot4.png?raw=true)
## Features
- Allows to setup, configure and use the Steam Controller without ever launching Steam
- Connect multiple controllers at the same time
- Supports profiles switchable in GUI or with controller button
- Stick, Pads and Gyroscope input
- Haptic Feedback and in-game Rumble support
- OSD, Menus, On-Screen Keyboard for desktop *and* in games.
- Automatic profile switching based on active window.
- Macros, button cycling, rapid fire, modeshift, mouse regions, …
- Emulates Xbox360 controller, mouse, trackball and keyboard.
Based on [Standalone Steam Controller Driver](https://github.com/ynsta/steamcontroller) by [Ynsta](https://github.com/ynsta).
## Like what I'm doing?
You can check out the ways to donate on [my website](https://rys.rs/donate), or just go straight to my [Ko-Fi](https://ko-fi.com/martinrys).
Donation links for kozec, who is the original developer, can be found on the [old upstream repository](https://github.com/kozec/sc-controller?tab=readme-ov-file#like-what-im-doing).
## Packages
[](https://repology.org/project/sc-controller/versions)
Linux:
- **Arch Linux:** Found in official [extra](https://archlinux.org/packages/extra/x86_64/sc-controller/) repository and [AUR/sc-controller-git](https://aur.archlinux.org/packages/sc-controller-git/)
- **Ubuntu (24.04-noble, 26.04-resolute):** Packaged as AppImage in [GitHub releases](https://github.com/C0rn3j/sc-controller/releases), ***which may also run fine on other operating systems - noble image is currently the most compatible one***
- **Gentoo:** Packaged as [game-util/sc-controller](https://packages.gentoo.org/packages/games-util/sc-controller)
- **Void Linux:** Packaged as [sc-controller](https://github.com/void-linux/void-packages/blob/master/srcpkgs/sc-controller/template) - Run `xbps-install -S sc-controller` in a terminal, points to archived Ryochan7's fork at the time of writing
- **Others:** You can attempt to use one of the AppImages (try all, AppImages built on older distributions tend to work better), or a package meant for your parent distribution if applicable. Flatpak is planned.
Windows:
- It should be possible to get it running as per the [wiki](https://github.com/C0rn3j/sc-controller/wiki/Running-SC-Controller-on-Windows), but this is untested and might be broken, report a bug if so
## Building the package by yourself
### Dependencies
- Python 3.11+
- GTK 3.24+
- [PyGObject](https://live.gnome.org/PyGObject)
- [python-gi-cairo](https://packages.debian.org/sid/python-gi-cairo) and [gir1.2-rsvg-2.0](https://packages.debian.org/sid/gir1.2-rsvg-2.0) on Debian-based distributions (included in PyGObject elsewhere)
- [setuptools](https://pypi.python.org/pypi/setuptools)
- [python-evdev](https://python-evdev.readthedocs.io/en/latest/)
- [python-pylibacl](http://pylibacl.k1024.org/)
- [python-vdf](https://pypi.org/project/vdf/)
- [python-libusb1](https://github.com/vpelletier/python-libusb1)
- [python-ioctl-opt](https://pypi.org/project/ioctl-opt/)
- [gtk-layer-shell](https://github.com/wmww/gtk-layer-shell)
### Via Python into a local build directory
- ~~Download and extract [latest release](https://github.com/C0rn3j/sc-controller/releases/latest)~~ .zip releases without .git directory are currently broken - tracked in [#50](https://github.com/C0rn3j/sc-controller/issues/50)
- Clone the repository `git clone https://github.com/C0rn3j/sc-controller.git` and navigate into it: `cd sc-controller`
- `python3 -m build --wheel`
- `python3 -m installer --destdir="./build" dist/*.whl`
- Run the app via: `SCC_SHARED="${PWD}" PYTHONPATH="./build/usr/lib/python3.12/site-packages" PATH="${PWD}/build/usr/bin:${PATH}" ./build/usr/bin/sc-controller`
### Via Docker
A test build with Docker can be created using the following way:
```bash
docker build -o build-output --build-arg BASE_CODENAME=noble .
```
### Via Python venv through run.sh
- ~~Download and extract [latest release](https://github.com/C0rn3j/sc-controller/releases/latest)~~ .zip releases without .git directory are currently broken - tracked in [#50](https://github.com/C0rn3j/sc-controller/issues/50)
- Clone the repository `git clone https://github.com/C0rn3j/sc-controller.git` and navigate into it: `cd sc-controller`
- Optionally checkout a branch or a tag, like `python3`(default) or `v0.4.9.8.8`
- Execute `./run.sh`, this automatically builds the project into a venv called `.env`, activates it and runs sc-controller, which in turn runs scc-daemon if one does not run already
- If you are debugging an issue, running `./run.sh daemon` first will launch the daemon in debug mode, allowing you to launch sc-controller in another terminal with `./run.sh`
C0rn3j-sc-controller-f3b142b/TODO.md 0000664 0000000 0000000 00000001766 15226114475 0017052 0 ustar 00root root 0000000 0000000 List of (possibly) planned features in no particular order:
- Multiple on-screen menus (and possibly keyboards) when using multiple controllers
- Injecting emulated xbox controller into wine
Hard stuff:
- Injecting emulated xbox controller into PlayOnLinux
Very hard stuff:
- Visual feedback in binding editor ( [what this guy says](https://www.reddit.com/r/linux_gaming/comments/5pcdmr/sc_controller_use_steam_controller_without_steam/dcqpvf4/) )
**Done** stuff:
- Multicontroller support
- Configurable gamepad type (e.g. 4 axes and 16 buttons)
- Steam Profile import
- Radial Menu for the Joystick/Trackpad
- Copy & paste
- Cycling Buttons
- Process monitor (or active window monitor) with switch
- Mouse regions
- Touch-Menu
- Menu in OSD
- OSD
- double click
- on-screen keyboard
- Spining mouse wheel rotation
- Haptic feedback support
- Gyroscope input
- Gamepad button as modifier (modeshift)
- Macros
- Turbo
- Trigger settings
- DPAD that acts only when clicked
- 8-way DPAD
- Selector for media keys C0rn3j-sc-controller-f3b142b/appimage-build.sh 0000775 0000000 0000000 00000016065 15226114475 0021200 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -ex
APP="sc-controller"
EXEC="scc"
LIB="lib"
EVDEV_VERSION=0.7.0
[[ "$BUILD_APPDIR" == "" ]] && BUILD_APPDIR=$(pwd)/appimage
PYTHON_VERSION=$(python3 -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}".format(*version))')
SITE_PACKAGES_PATH=$(python3 -c "import os,sys; print([p for p in sys.path if p.endswith('site-packages') and sys.prefix in p][0])")
if [[ -z "${SITE_PACKAGES_PATH}" ]]; then
echo "Could not determine global site-packages path. Exiting"
exit 1
fi
function download_dep() {
NAME=$1
URL=$2
if [ -e ../../${NAME}.obstargz ] ; then
# Special case for OBS
cp ../../${NAME}.obstargz /tmp/${NAME}.tar.gz
elif [ -e ${NAME}.tar.gz ] ; then
cp ${NAME}.tar.gz /tmp/${NAME}.tar.gz
elif [ -e /tmp/${NAME}.tar.gz ] ; then
echo "/tmp/${NAME}.tar.gz already downloaded"
else
wget -c "${URL}" -O /tmp/${NAME}.tar.gz
fi
}
function build_dep() {
NAME="$1"
mkdir -p /tmp/${NAME}
pushd /tmp/${NAME}
tar --extract --strip-components=1 -f /tmp/${NAME}.tar.gz
PYTHONPATH=${BUILD_APPDIR}/usr/lib/python${PYTHON_VERSION}/site-packages python3 \
setup.py install --optimize=1 \
--prefix="/usr/" --root="${BUILD_APPDIR}"
mkdir -p "${BUILD_APPDIR}/usr/lib/python${PYTHON_VERSION}/site-packages/"
python3 setup.py install --prefix="/usr/" --root="${BUILD_APPDIR}"
popd
}
function unpack_dep() {
NAME="$1"
pushd ${BUILD_APPDIR}
tar --extract --exclude="usr/include**" --exclude="usr/lib/pkgconfig**" \
--exclude="usr/lib/python2.7**" -f /tmp/${NAME}.tar.gz
popd
}
# Download deps
download_dep "python-evdev-0.7.0" "https://github.com/gvalkov/python-evdev/archive/v0.7.0.tar.gz"
download_dep "pylibacl-0.6.0" "https://github.com/iustin/pylibacl/releases/download/v0.6.0/pylibacl-0.6.0.tar.gz"
download_dep "python-gobject-3.36.1" "https://archive.archlinux.org/packages/p/python-gobject/python-gobject-3.36.1-1-x86_64.pkg.tar.zst"
download_dep "python-vdf-3.4" "https://github.com/ValvePython/vdf/archive/v3.4.tar.gz"
download_dep "libpng-1.6.34" "https://archive.archlinux.org/packages/l/libpng/libpng-1.6.34-2-x86_64.pkg.tar.xz"
download_dep "gdk-pixbuf-2.36.9" "https://archive.archlinux.org/packages/g/gdk-pixbuf2/gdk-pixbuf2-2.36.9-1-x86_64.pkg.tar.xz"
download_dep "libcroco-0.6.13" "https://archive.archlinux.org/packages/l/libcroco/libcroco-0.6.13-1-x86_64.pkg.tar.xz"
download_dep "libxml2-2.9.10" "https://archive.archlinux.org/packages/l/libxml2/libxml2-2.9.10-2-x86_64.pkg.tar.zst"
download_dep "librsvg-2.48.7" "https://archive.archlinux.org/packages/l/librsvg/librsvg-2%3A2.48.7-1-x86_64.pkg.tar.zst"
download_dep "icu-67.1" "https://archive.archlinux.org/packages/i/icu/icu-67.1-1-x86_64.pkg.tar.zst"
download_dep "zlib-1:1.2.12" "https://archive.archlinux.org/packages/z/zlib/zlib-1%3A1.2.12-2-x86_64.pkg.tar.zst"
download_dep "libffi-3.4.3" "https://archive.archlinux.org/packages/l/libffi/libffi-3.4.3-1-x86_64.pkg.tar.zst"
# Prepare & build deps
export PYTHONPATH=${BUILD_APPDIR}/usr/lib/python${PYTHON_VERSION}/site-packages/
mkdir -p "$PYTHONPATH"
if [[ $(grep ID_LIKE /etc/os-release) == *"suse"* ]] ; then
# Special handling for OBS
ln -s lib64 ${BUILD_APPDIR}/usr/lib
export PYTHONPATH="$PYTHONPATH":${BUILD_APPDIR}/usr/lib64/python${PYTHON_VERSION}/site-packages/
LIB=lib64
fi
build_dep "python-evdev-0.7.0"
build_dep "pylibacl-0.6.0"
build_dep "python-vdf-3.4"
unpack_dep "python-gobject-3.36.1"
unpack_dep "libpng-1.6.34"
unpack_dep "gdk-pixbuf-2.36.9"
unpack_dep "libcroco-0.6.13"
unpack_dep "libxml2-2.9.10"
unpack_dep "librsvg-2.48.7"
unpack_dep "icu-67.1"
unpack_dep "zlib-1:1.2.12"
unpack_dep "libffi-3.4.3"
# Remove uneeded files
rm -f "${BUILD_APPDIR}/usr/${LIB}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.so"
rm -f "${BUILD_APPDIR}/usr/${LIB}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-bmp.so"
rm -f "${BUILD_APPDIR}/usr/${LIB}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-gif.so"
rm -f "${BUILD_APPDIR}/usr/${LIB}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-icns.so"
rm -f "${BUILD_APPDIR}/usr/${LIB}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ico.so"
rm -f "${BUILD_APPDIR}/usr/${LIB}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jasper.so"
rm -f "${BUILD_APPDIR}/usr/${LIB}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.so"
rm -f "${BUILD_APPDIR}/usr/${LIB}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-qtif.so"
rm -f "${BUILD_APPDIR}/usr/${LIB}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-tga.so"
rm -f "${BUILD_APPDIR}/usr/${LIB}/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-tiff.so"
rm -R "${BUILD_APPDIR}/usr/lib/cmake"
rm -R "${BUILD_APPDIR}/usr/share/doc"
rm -R "${BUILD_APPDIR}/usr/share/gtk-doc"
rm -R "${BUILD_APPDIR}/usr/share/locale"
rm -R "${BUILD_APPDIR}/usr/share/man"
rm -R "${BUILD_APPDIR}/usr/share/thumbnailers"
rm -R "${BUILD_APPDIR}/usr/share/vala"
rm -R "${BUILD_APPDIR}/usr/share/icu"
# Build important part. Need executable flag to place custom interpreter line.
# Setuptools overrrides original #! line in scripts with /usr/bin/python.
# Ubuntu 22.04 LTS does not provide an executable at /usr/bin/python
# by default.
python3 setup.py build --executable "/usr/bin/env python3"
# Need to use single-version-externally-managed due to setuptools behavior
python3 setup.py install --single-version-externally-managed --prefix ${BUILD_APPDIR}/usr --record /dev/null
# Move udev stuff
mv ${BUILD_APPDIR}/usr/lib/udev/rules.d/69-${APP}.rules ${BUILD_APPDIR}/
rmdir ${BUILD_APPDIR}/usr/lib/udev/rules.d/
rmdir ${BUILD_APPDIR}/usr/lib/udev/
mkdir -p ${BUILD_APPDIR}/usr/${LIB}/python${PYTHON_VERSION}/site-packages/scc/
cp "/usr/include/linux/input-event-codes.h" ${BUILD_APPDIR}/usr/${LIB}/python${PYTHON_VERSION}/site-packages/scc/
# Move & patch desktop file
mv ${BUILD_APPDIR}/usr/share/applications/${APP}.desktop ${BUILD_APPDIR}/
sed -i "s/Icon=.*/Icon=${APP}/g" ${BUILD_APPDIR}/${APP}.desktop
sed -i "s/Exec=.*/Exec=.\/usr\/bin\/scc gui/g" ${BUILD_APPDIR}/${APP}.desktop
# Convert icon
convert -background none ${BUILD_APPDIR}/usr/share/pixmaps/${APP}.svg ${BUILD_APPDIR}/${APP}.png
# Copy appdata.xml
mkdir -p ${BUILD_APPDIR}/usr/share/metainfo/
cp scripts/${APP}.appdata.xml ${BUILD_APPDIR}/usr/share/metainfo/${APP}.appdata.xml
# Make symlinks
ln -sfr ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/libcemuhook.cpython-310-x86_64-linux-gnu.so ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/libcemuhook.so
ln -sfr ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/libhiddrv.cpython-310-x86_64-linux-gnu.so ${BUILD_APPDIR}${SITE_PACKAGES_PATH}//libhiddrv.so
ln -sfr ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/libremotepad.cpython-310-x86_64-linux-gnu.so ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/libremotepad.so
ln -sfr ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/libsc_by_bt.cpython-310-x86_64-linux-gnu.so ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/libsc_by_bt.so
ln -sfr ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/libuinput.cpython-310-x86_64-linux-gnu.so ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/libuinput.so
ln -sfr ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/posix1e.cpython-310-x86_64-linux-gnu.so ${BUILD_APPDIR}${SITE_PACKAGES_PATH}/posix1e.so
# Copy AppRun script
cp scripts/appimage-AppRun.sh ${BUILD_APPDIR}/AppRun
chmod +x ${BUILD_APPDIR}/AppRun
echo "Run appimagetool -n ${BUILD_APPDIR} to finish prepared appimage"
C0rn3j-sc-controller-f3b142b/daemon.sh 0000775 0000000 0000000 00000000467 15226114475 0017562 0 ustar 00root root 0000000 0000000 #!/bin/bash
# Ensure correct cwd
cd "$(dirname "$0")"
# Set PATH
SCRIPTS="$(pwd)/scripts"
export PATH="$SCRIPTS":"$PATH"
export PYTHONPATH=".":"$PYTHONPATH"
export SCC_SHARED="$(pwd)"
if [ "$1" == "lldb" ] ; then
shift
lldb python3 -- 'scripts/scc-daemon' debug $@
else
python3 'scripts/scc-daemon' $@
fi
C0rn3j-sc-controller-f3b142b/default_menus/ 0000775 0000000 0000000 00000000000 15226114475 0020604 5 ustar 00root root 0000000 0000000 C0rn3j-sc-controller-f3b142b/default_menus/.autoswitch.menu 0000664 0000000 0000000 00000000141 15226114475 0023736 0 ustar 00root root 0000000 0000000 [{
"separator": true,
"name": "Autoswitch Options"
}, {
"generator": "autoswitch"
}]
C0rn3j-sc-controller-f3b142b/default_menus/.games.menu 0000664 0000000 0000000 00000000120 15226114475 0022635 0 ustar 00root root 0000000 0000000 [{
"separator": true,
"name": "Games"
}, {
"generator" : "games"
}]
C0rn3j-sc-controller-f3b142b/default_menus/.windowlist.menu 0000664 0000000 0000000 00000000131 15226114475 0023746 0 ustar 00root root 0000000 0000000 [{
"separator": true,
"name": "Switch to"
}, {
"generator" : "windowlist"
}]
C0rn3j-sc-controller-f3b142b/default_menus/Default.menu 0000664 0000000 0000000 00000001140 15226114475 0023052 0 ustar 00root root 0000000 0000000 [{
"separator": true,
"name": "Recent profiles"
}, {
"generator": "recent",
"rows": 3
}, {
"submenu": "Profiles.menu",
"icon": "system/profiles",
"name": "All Profiles"
}, {
"separator": true,
"name": "Options"
}, {
"submenu": ".autoswitch.menu",
"icon": "system/autoswitch",
"name": "Autoswitch Options"
}, {
"action": "turnoff()",
"id": "item4",
"icon": "system/turn-off",
"name": "Turn Controller OFF",
"osd": true
}, {
"action": "keyboard()",
"id": "item5",
"icon": "system/keyboard",
"name": "Display Keyboard"
}]
C0rn3j-sc-controller-f3b142b/default_menus/Profiles.menu 0000664 0000000 0000000 00000000132 15226114475 0023251 0 ustar 00root root 0000000 0000000 [{
"separator": true,
"name": "All profiles"
}, {
"generator" : "profiles"
}]
C0rn3j-sc-controller-f3b142b/default_profiles/ 0000775 0000000 0000000 00000000000 15226114475 0021300 5 ustar 00root root 0000000 0000000 C0rn3j-sc-controller-f3b142b/default_profiles/.scc-osd.keyboard.sccprofile 0000664 0000000 0000000 00000002000 15226114475 0026553 0 ustar 00root root 0000000 0000000 {
"buttons": {
"A": { "action": "button(Keys.KEY_ENTER)" },
"B": { "action": "button(Keys.KEY_ESC)" },
"C": { "action": "OSK.close()" },
"LB": { "action": "button(Keys.KEY_BACKSPACE)" },
"RB": { "action": "button(Keys.KEY_SPACE)" },
"LGRIP": { "action": "button(Keys.KEY_LEFTSHIFT)" },
"LPAD": { "action": "OSK.press(LEFT)" },
"RGRIP": { "action": "button(Keys.KEY_RIGHTALT)" },
"RPAD": { "action": "OSK.press(RIGHT)" },
"START": { "action": "button(Keys.KEY_TAB)" },
"X": { "action": "OSK.close()" },
"Y": { "action": "OSK.close()" }
},
"pad_left": { "action": "OSK.cursor(LEFT)" },
"pad_right": { "action": "OSK.cursor(RIGHT)" },
"trigger_left": { "action": "button(Keys.KEY_LEFTSHIFT)" },
"trigger_right": { "action": "button(Keys.KEY_LEFTCTRL)" },
"stick": {
"action": "dpad(button(Keys.KEY_UP), button(Keys.KEY_DOWN), button(Keys.KEY_LEFT), button(Keys.KEY_RIGHT))",
"modes": { "RGRIP": { "action": "OSK.move()" } }
},
"gyro": {},
"menus": {},
"version": 1
}
C0rn3j-sc-controller-f3b142b/default_profiles/.scc-osd.profile_editor.sccprofile 0000664 0000000 0000000 00000002374 15226114475 0027777 0 ustar 00root root 0000000 0000000 {
"_": "",
"buttons": {
"A": {
"action": "button(Keys.KEY_SPACE)"
},
"B": {
"action": "button(Keys.KEY_ESC)"
},
"C": {
"action": "restart()"
},
"LB": {
"action": "button(Keys.KEY_BACKSPACE)"
},
"LPAD": {
"action": "button(Keys.BTN_RIGHT)"
},
"RB": {
"action": "button(Keys.KEY_SPACE)"
},
"RPAD": {
"action": "button(Keys.BTN_LEFT)"
},
"Y": {
"action": "button(Keys.KEY_F2)"
}
},
"cpad": {},
"gyro": {},
"is_template": false,
"menus": {},
"pad_left": {
"action": "feedback(LEFT, 4090, 16, ball(XY(mouse(Rels.REL_HWHEEL), mouse(Rels.REL_WHEEL))))"
},
"pad_right": {
"action": "smooth(8, 0.78, 2.0, feedback(RIGHT, 256, ball(mouse())))"
},
"stick": {
"action": "dpad(button(Keys.KEY_UP), button(Keys.KEY_DOWN), button(Keys.KEY_LEFT), button(Keys.KEY_RIGHT))"
},
"trigger_left": {
"action": "trigger(50, 50, button(Keys.BTN_RIGHT))"
},
"trigger_right": {
"action": "trigger(50, 255, button(Keys.BTN_LEFT))"
},
"version": 1.4
} C0rn3j-sc-controller-f3b142b/default_profiles/Desktop.sccprofile 0000664 0000000 0000000 00000003036 15226114475 0024766 0 ustar 00root root 0000000 0000000 {
"_": "",
"buttons": {
"A": {
"action": "button(Keys.KEY_ENTER)"
},
"B": {
"action": "button(Keys.KEY_ESC)"
},
"BACK": {
"action": "button(Keys.KEY_BACKSPACE)"
},
"C": {
"action": "hold(menu('Default.menu'), menu('Default.menu'))"
},
"CPADPRESS": {
"action": "button(Keys.BTN_LEFT)"
},
"LB": {
"action": "button(Keys.KEY_LEFTCTRL)"
},
"RB": {
"action": "button(Keys.KEY_LEFTALT)"
},
"RPAD": {
"action": "button(Keys.BTN_LEFT)"
},
"START": {
"action": "button(Keys.KEY_LEFTSHIFT)"
},
"X": {
"action": "button(Keys.KEY_SPACE)"
},
"Y": {
"action": "button(Keys.KEY_TAB)"
}
},
"cpad": {
"action": "mouse()"
},
"gyro": {},
"is_template": false,
"menus": {},
"pad_left": {
"action": "feedback(LEFT, 4096, 16, ball(XY(mouse(Rels.REL_HWHEEL, 1.0), mouse(Rels.REL_WHEEL, 1.0))))"
},
"pad_right": {
"action": "smooth(8, 0.78, 2.0, feedback(RIGHT, 256, ball(mouse())))"
},
"stick": {
"action": "dpad(button(Keys.KEY_UP), button(Keys.KEY_DOWN), button(Keys.KEY_LEFT), button(Keys.KEY_RIGHT))"
},
"trigger_left": {
"action": "button(Keys.BTN_RIGHT)"
},
"trigger_right": {
"action": "button(Keys.BTN_LEFT)"
},
"version": 1.4
}
C0rn3j-sc-controller-f3b142b/default_profiles/XBox Controller with High Precision Camera.sccprofile 0000664 0000000 0000000 00000003156 15226114475 0033225 0 ustar 00root root 0000000 0000000 {
"_": "",
"buttons": {
"A": {
"action": "button(Keys.BTN_GAMEPAD)"
},
"B": {
"action": "button(Keys.BTN_EAST)"
},
"BACK": {
"action": "button(Keys.BTN_SELECT)"
},
"C": {
"action": "hold(menu('Default.menu'), menu('Default.menu'))"
},
"LB": {
"action": "button(Keys.BTN_TL)"
},
"LGRIP": {
"action": "button(Keys.BTN_GAMEPAD)"
},
"RB": {
"action": "button(Keys.BTN_TR)"
},
"RGRIP": {
"action": "button(Keys.BTN_NORTH)"
},
"RPAD": {
"action": "button(Keys.BTN_THUMBR)"
},
"START": {
"action": "button(Keys.BTN_START)"
},
"STICKPRESS": {
"action": "button(Keys.BTN_THUMBL)"
},
"X": {
"action": "button(Keys.BTN_NORTH)"
},
"Y": {
"action": "button(Keys.BTN_WEST)"
}
},
"cpad": {},
"gyro": {},
"is_template": false,
"menus": {},
"pad_left": {
"action": "click(dpad(hatup(Axes.ABS_HAT0Y), hatdown(Axes.ABS_HAT0Y), hatleft(Axes.ABS_HAT0X), hatright(Axes.ABS_HAT0X)))"
},
"pad_right": {
"action": "smooth(8, 0.78, feedback(RIGHT, 256, ball(mouse())))"
},
"stick": {
"action": "sens(1.2, 1.2, XY(axis(Axes.ABS_X), raxis(Axes.ABS_Y)))"
},
"trigger_left": {
"action": "axis(Axes.ABS_Z)"
},
"trigger_right": {
"action": "axis(Axes.ABS_RZ)"
},
"version": 1.4
} C0rn3j-sc-controller-f3b142b/default_profiles/XBox Controller.sccprofile 0000664 0000000 0000000 00000003202 15226114475 0026334 0 ustar 00root root 0000000 0000000 {
"_": "",
"buttons": {
"A": {
"action": "button(Keys.BTN_GAMEPAD)"
},
"B": {
"action": "button(Keys.BTN_EAST)"
},
"BACK": {
"action": "button(Keys.BTN_SELECT)"
},
"C": {
"action": "hold(menu('Default.menu'), menu('Default.menu'))"
},
"LB": {
"action": "button(Keys.BTN_TL)"
},
"LGRIP": {
"action": "button(Keys.BTN_GAMEPAD)"
},
"RB": {
"action": "button(Keys.BTN_TR)"
},
"RGRIP": {
"action": "button(Keys.BTN_NORTH)"
},
"RPAD": {
"action": "button(Keys.BTN_THUMBR)"
},
"START": {
"action": "button(Keys.BTN_START)"
},
"STICKPRESS": {
"action": "button(Keys.BTN_THUMBL)"
},
"X": {
"action": "button(Keys.BTN_NORTH)"
},
"Y": {
"action": "button(Keys.BTN_WEST)"
}
},
"cpad": {},
"gyro": {
"action": "cemuhook"
},
"is_template": false,
"menus": {},
"pad_left": {
"action": "click(dpad(hatup(Axes.ABS_HAT0Y), hatdown(Axes.ABS_HAT0Y), hatleft(Axes.ABS_HAT0X), hatright(Axes.ABS_HAT0X)))"
},
"pad_right": {
"action": "feedback(RIGHT, 256, XY(axis(Axes.ABS_RX), raxis(Axes.ABS_RY)))"
},
"stick": {
"action": "sens(1.2, 1.2, XY(axis(Axes.ABS_X), raxis(Axes.ABS_Y)))"
},
"trigger_left": {
"action": "axis(Axes.ABS_Z)"
},
"trigger_right": {
"action": "axis(Axes.ABS_RZ)"
},
"version": 1.4
}
C0rn3j-sc-controller-f3b142b/docs/ 0000775 0000000 0000000 00000000000 15226114475 0016701 5 ustar 00root root 0000000 0000000 C0rn3j-sc-controller-f3b142b/docs/actions.md 0000775 0000000 0000000 00000052246 15226114475 0020677 0 ustar 00root root 0000000 0000000 ### In this document
- [Custom Action page](#examples1)
- [List of all known actions](#actions)
- [Macros and operators](#macros)
- [Profile file examples](#examples2)
# Custom Action page examples
- To do two or more things at once, type `action() and action()`
- To do two or more things in sequence, type `action() ; action()`
- Typing second action on new line is same thing as using `and`
#### Press button repeadedly, rapid fire mode
`repeat(button(BTN_A))` (see [repeat](#repeat), [button](#button))
#### Press Alt+F4
`button(KEY_LEFTALT) and button(KEY_F4)`
#### Press multiple buttons in sequence
`button(BTN_A) ; button(BTN_X); button(BTN_B)`
#### Press button and hold it for set delay
`press(BTN_A) ; sleep(0.5); release(BTN_B)` (see [press](#press), [sleep](#sleep), [release](#release))
# Actions
#### button(button1 [, button2 = None ])
- For button, simply maps real button to emulated
- For stick or pad, 'button1' is pressed when stick or finger on pad is moved
to up or left and 'button2' when to down or right.
Using [dpad](#dpad) may be better for such situations.
- For trigger, when trigger is pressed, but until it clicks, 'button2' is
pressed. When trigger clicks 'button2' is released and replaced by 'button1'.
If only 'button1' is set, trigger acts as big button.
Note that 'button2' is always optional.
#### mouse(axis)
- For stick, lets cursor or mouse wheel to be controlled by stick tilt.
- For pad, acts as trackpad - sliding finger over pad moves the mouse.
If set to *REL_WHEEL* or *REL_HWHEEL*, emulates finger scroll.
You can use `ball(mouse)` to emulate trackball.
- For gyroscope, controls mouse with changes in controller pitch and roll/yaw.
Axis parameter should be either YAW or ROLL (constants) and decides which
gyroscope axis controls X mouse axis.
- For button, pressing button maps to single movement over mouse axis or
single step on scroll wheel.
#### mouseabs(axis)
- For stick, lets cursor or mouse wheel to be controlled by stick tilt.
- For pad, distance from center of pad controls speed of mouse movement
- For gyroscope, please, use gyroabs action.
#### trackpad(axis)
Merged with [mouse](#mouse), does same thing.
#### axis(id [, min = -32767, max = 32767 ])
- For button, pressing button maps to moving axis full way to 'max'.
eleasing button returns emulated axis back to 'min'.
- For stick or pad, simply maps real axis to emulated
- For trigger, maps trigger position to to emulated axis. Note that default
trigger position is not in middle, but in minimal possible value.
#### dpad([diagonal_range,] up, down, left, right)
Emulates dpad. Touchpad is divided into 8 triangular parts. When the user
touches the touchpad, action is executed depending on finger position.
'diagonal_range' is specified in degrees (1 to 89). If not set, all parts are
sized equally, otherwise, diagonal parts are taking specified portion of pad
and rest is assigned to up/left/right/down portions.
Available only for pads and sticks.
#### dpad8([diagonal_range,] up, down, left, right, upleft, upright, downleft, downright)
Same as dpad, with more directions.
#### ring([radius=0.5], inner, outer)
Defines outer and inner ring bindings. When distance of finger from center of
pad is smaller than 'radius', 'inner' action is activated, otherwise, 'outer'
takes place.
Unlike [dpad](#dpad), which executes actions as if they were bound to buttons,
ring works more like defining two actions on same pad with non-overlapping
deadzones.
#### area(x1, y1, x2, y2), winarea(x1, y1, x2, y2)
Creates 1:1 mapping between finger position on pad and mouse position in
specified screen area. Coordinates are in pixels with (0,0) on top,left corner.
Negative number can be used to count from other side of screen.
`winarea` does same thing but with position relative to current window instead of entire screen.
#### relarea(x1, y1, x2, y2), relwinarea(x1, y1, x2, y2)
Creates 1:1 mapping between finger position on pad and mouse position in
specified screen area. Coordinates are fractions of screen width and height,
(0,0) is top,left and (1,1) bottom,right corner of screen.
`relwinarea` does same thing but with position relative to current window instead of entire screen.
#### trigger(press_level, [release_level, ] action)
Maps action to be executed as by button press when trigger is pressed through
'press_level'. Level goes from 0 to 255, where 255 is level after physical
trigger clicks.
Then, optionally, if trigger is pressed through 'release_level', action is
"released". If release_level is not set, action will be released only after
trigger value moves back beyond press_level.
It's possible to map multiple actions on different trigger levels using [and](#and).
Examples:
Hold right mouse button while trigger is being pressed, press left button when
trigger clicks. Right button is released only when trigger is fully released.
```
trigger(64, 255, button(BTN_RIGHT)) and trigger(255, button(BTN_LEFT))
```
Control left virtual trigger while trigger is being pressed and press left button
just before trigger clicks. If trigger clicks, press enter key and play feedback.
```
trigger(64, 255, axis(ABS_Z))
and
trigger(240, 254, button(BTN_LEFT))
and
trigger(255, feedback(LEFT, button(KEY_ENTER)))
```
#### hipfire([partialpress_level, ][fullpress_level, ] partialpress_action, fullpress_action [, mode][, delay])
Maps two different actions to be executed when trigger is inside a defined range and meet predefined conditions.
Basically, the "partialpress_action" will be activated if the trigger is pressed passed the "partialpress_level" and it stays inside the range between this level and the "fullpress_level" until the "delay" ends, otherwise, the "fullpress_action" will be activated ALONE if the "fullpress_level" is reached before the "delay" ends.
The partial and full levels goes from 0 to 255, and the values 50 and 254 are used for "partialpress_level" and "fullpress_level", respectively, if none is passed.
The "mode" can be defined as described below and the "NORMAL" one is used if none is passed.
Modes available:
- NORMAL - if trigger is pressed beyond the "partialpress_level" and the timeout is reached, the "partialpress_action" is executed. If the "partialpress_action" was pressed it will only be released after the trigger return back beyond the "partialpress_level". The "fullpress_action" will be executed every time the "fullpress_level" is reached, but if this level is reached before the timeout the "partialpres_action" will not be triggered until releasing the trigger.
- EXCLUSIVE - Acts similar to the previous mode, but the "fullpress_action" is only triggered if the "partialpres_action" was not triggered. Meaning it will only activate if the "fullpress_level" is reached before the timeout ends.
- SENSIBLE - Acts similar to NORMAL, but after the "partialpress_action" is activated, releasing the trigger a little, will deactivate the action allowing it to be activated again more faster without needing to release the trigger back beyond the "partialpress_level".
The "delay" is time window used to determine if the "partialpress_action" should or not be activated.
Examples:
Hold right mouse button while trigger is being softly pressed and press left mouse button when trigger click, but will bypass the right mouse button and only press the left mouse button if the trigger is pressed very fast to the click.
```
hipfire(50, 254, button(BTN_RIGHT),button(BTN_LEFT), NORMAL, 0.20)
```
Press A if the trigger is pressed slowly and not reaches the click or press B if the trigger is pressed fast and reached the click, and will execute only one of this two actions.
```
hipfire(50, 254, button(KEY_A),button(KEY_B), EXCLUSIVE, 0.15)
```
#### gyro(axis1 [, axis2 [, axis3]])
Maps *changes* in gyroscope pitch, yaw and roll movement into movements of gamepad stick.
Can be used to map gyroscope to camera when camera can be controlled only with analog stick.
#### gyroabs(axis1 [, axis2 [, axis3]])
Maps absolute gyroscope pitch, yaw and roll movement into movements of mouse
or gamepad stick.
Can be used to map gyroscope to movement stick or to use controller as racing wheel.
#### resetgyro()
Resets gyroscope offsets so current orientation is treated as neutral.
#### cemuhook()
When set to gyro, outputs gyroscope data in way compatibile with Cemu, Citra and
other applications using CemuHookUDP motion provider protocol.
#### gyro(front_down, front_up, tilt_left, tilt_right)
Maps tilting of gamepad into actions. When gamepad is tilt to one of for supported
sides, assigned action is executed as if by button press and then "released" after
gamepad is balanced again.
#### trackball()
Split to [ball](#ball) modifier and [mouse](#mouse) action.
Typing `trackball` works as alias for `ball(mouse())`
#### XY(xaction, yaction)
Provides way to assign two different actions to two stick or pad axes.
This is automatically handled by GUI, so user usually doesn't need
to write it directly.
#### relXY(xaction, yaction)
Works same as [XY](#XY), but treats position where pad is touched as "center"
of pad.
#### press(button)
Presses button and leaves it pressed.
#### release(button)
Releases pressed button.
#### tap(button, number=1)
Presses button for a short while, 'number' times.
If 'number' is greater than 1 (when double-tap is performed), tapped button
is kept press as long as physical button that started tap is pressed. For single
tap, virtual button is released right away.
If virtual button is already pressed before tapping, it is released first and
restored after tap, resulting in sequence of "release - press - release - press"
#### profile(name)
Loads another profile
#### shell(command)
Executes command on background
#### turnoff()
Turns controller off
#### restart()
Restarts scc-daemon. Don't use unless you have good reason to.
#### led(brightness)
Sets brightness of controller led. 'Brightness' is percent in 0 to 100 range.
#### osd([timeout=5, [size=3]], text)
Displays message in OSD.
'timeout' sets for how many seconds should message stay visible. Value of 0 has
special meaning and leaves message displayed indefinitely, until profile is
changed or [clearosd](#clearosd) action is used.
'size' sets size of font on message. Only three options are supported right now,
3 for "default size", 2 for "smalller" and 1 for "small".
#### clearosd()
Clears all windows from OSD layer. Cancels all menus, clears all messages,
hides on screen keyboard.
Does _not_ clear OSD windows created using command line tools.
#### menu(menu [, confirm_button=A [, cancel_button=B [, show_with_release=False]]]])
Displays OSD menu.
'confirm_button' and 'cancel_button' sets which gamepad button should be used to
confirm/cancel menu. Additionaly, 'confirm_button' can be set to SAME (constant),
in which case menu will be closed and selected item choosen when button used to
display menu is released.
If 'show_with_release' is set to true, menu is displayed only after button
is released.
'menu' can be either id of menu defined in same profile file or filename
relative to `~/.config/scc/menus` or `/usr/share/scc/default_menus/`, whichever
exists, in that order.
#### hmenu(menu [, confirm_button=A [, cancel_button=B [, show_with_release=False]]]])
Same as `menu`, but packed in one row.
#### gridmenu(menu [, confirm_button=A [, cancel_button=B [, show_with_release=False]]]])
Same as `menu`, but displays items in grid.
#### radialmenu(menu [, confirm_button=A [, cancel_button=B [, show_with_release=False]]]])
Same as `menu`, but displays items in radial menu.
#### quickmenu(menu)
Special kind of menu controled by buttons instead of stick. Every item has
assigned button and user selects it by pressing that button.
Fast to use, but is limited to 6 items at most.
#### dialog([ confirm_button=A [, cancel_button=B ], ] text, action1, [action2... actionN])
Displays OSD dialog. Dialog works similary to horizontal menu and displays
text message above list of options.
#### keyboard()
Displays on-screen keyboard
# Modifiers:
#### click(action)
Creates action action that occurs only if pad or stick is pressed.
For example, `click(dpad(...))` set to pad will create dpad that activates
buttons only when pressed.
#### pressed(action)
Creates action that occurs for brief moment when button is pressed.
For example, `pressed(button(A))` will press and instantly release virtual
A button whenever physical button is pressed.
#### released(action)
Creates action that occurs for brief moment when button is released.
#### pressed(action)
Creates action that occurs for brief moment when finger touches pad.
#### released(action)
Creates action that occurs for brief moment when pad is released.
#### mode(button1, action1, [button2, action2... buttonN, actionN] [, default] )
Defines mode shifting. If physical buttonX is pressed, actionX is executed.
Optional default action is executed if none from specified buttons is pressed.
#### gestures([precision=0,] gesture1, action1, [gesture2, action2... gestureN, actionN] )
If set to left or right pad, enables gesture recognition. If GestureX
is drawn, actionX is executed.
If 'precision' is set to 1.0, gesture has to be exact. Otherwise,
gestures resembling input with given precision are compared and
one that matches it most is used. At precision of 0.0, all gestures are considered.
Gestures are encoded in string and it's
recommended to use GUI to record them. Nevertheless, format is simple:
- Each stroke in one of four directions is stored as single character.
- Characters are uppercase `U`, `D`, `L`, `R` for up, down, left, right
- Default stroke length is 1/3 of pad size.
- For stroke with twice of that length, characters is repeated twice
- Three times for stroke through entire pad, or even more for longer.
- If string starts with lowercase `i`, stroke length is ignored.
#### doubleclick(doubleclick_action [, normal_action [, timeout ]])
Executes action if user double-clicks button.
Optional normal_action parameter specifies action that is executed when user
click button only once. Optional time arguments modifies maximum delay in
doubleclick and in effect sets delay before normal action is executed.
#### hold(hold_action [, normal_action [, timeout ]])
Executes action if user holds button for longer time.
Optional normal_action parameter specifies action that is executed when user
click button shortly. Optional time arguments modifies how long "longer time" is.
Hold and doubleclick can be combined together by writing
`hold([time,] hold_action, doubleclick(doubleclick_action, normal_action))`
#### sens(x_axis [, y_axis [, z_axis]], action)
Modifies sensitivity of physical stick or pad.
#### rotate(angle, action)
Rotates input pad or stick input by given angle.
#### feedback(side, [amplitude=256 [, frequency=4 [, period=100 [, count=1 ]]]], action)
Enables haptic feedback for specified action, if action supports it.
Side has to be one of LEFT, RIGHT or BOTH. All remaining numbers can be anything
from 1 to 32767, but note that setting count to large number will start long
running feedback that you may not be able to stop.
'frequency' is used only when emulating touchpad and describes how many pixels
should mouse travel between two feedback ticks.
#### ball([friction=10.0, [mass=80.0, ]] action)
Enables trackball mode. Moving finger over pad will keep repeating same action
with decreasing speed, based on set mass and friction, until virtual
'spinning ball' stops moving.
#### circular(action)
Designed to controls scroll wheel by scrolling finger around pad.
Can be used with any axis. For example,
`circular(axis(Axes.ABS_X))`
turns touchpad into small raing wheel.
#### circular(action)
Works as to `circular`, but instead of counting with finger movements,
translates exact position on dpad to axis value.
#### deadzone([mode,] lower, [upper, ] action)
Enables deadzone on trigger, pad or stick.
Mode defaults to 'CUT' and can be one of:
- CUT - if value is out of deadzone range, output value is zero
- ROUND - for values bellow deadzone range, output value is zero. For values
above range, output value is maximum allowed.
- LINEAR - input value is scaled, so entire output range is covered by
range of deadzone.
- MINIMUM - any non-zero input value is scaled so entire input range is mapped
to range of deadzone. Zero on input is mapped to zero on output, so there is
area over which output "jumps" when stick is tilted.
#### smooth([buffer=8, [multiplier=0.7, [filter=2, ]]] action)
Enables input smoothing. Position is computed as weighed average of last X
input positions with highest weight given to most recent position. If 'filter'
is above zero, movements bellow that value are ignored.
#### osd([timeout=5], action)
Enables on screen display for action. In most cases just displays action
description in OSD and executes it normally.
Works only if executed by pressing physical button or with `dpad`. Otherwise
just executes child action.
#### position(x, y, action)
Specifies menu position on screen. X is position from left, Y from top. To
specify position from right or bottom, use negative values.
#### name(name, action)
Allow inline setting of action name
# Shortcuts:
#### raxis(id)
Shortcut for `axis(id, 32767, -32767)`, that is call to axis with min/max values
reversed. Effectively inverted axis mapping.
#### hatup(id)
Shortcut for `axis(id, 0, 32767)`, emulates moving hat up or pressing 'up'
button on dpad.
#### hatdown(id)
Shortcut for `axis(id, 0, -32767)`, emulates moving hat down or pressing 'down'
button on dpad.
#### hatleft(id), hatright(id)
Same thing as hatup/hatdown, as vertical hat movement and left/right dpad
buttons are same events on another axis
# Macros and operators
#### and - executing actions at once
It is possible to join two (or more) actions with `and` keyword (or newline) to have them executed together.
- `button(KEY_LEFTALT) and button(KEY_F4)` presses Alt+F4
#### semicolon - sequence (macro)
When `;` is placed between actions, they are executed as sequence.
- `hatup(ABS_Y); hatup(ABS_Y); button(BTN_B); button(BTN_A)` presses 'UP UP B A' on gamepad, as fast as possible
- `button(KEY_A); button(KEY_B); button(KEY_C)` types 'abc'.
#### type('text')
Special type of macro where keys to press are specified as string.
Basically, writing `type("iddqd")` is same thing as `button(KEY_I) ; button(KEY_D) ;
button(KEY_D); button(KEY_Q); button(KEY_D)`, just much shorter.
#### sleep(x)
To insert pause between macro actions, use sleep() action.
- `button(KEY_A); button(KEY_B); sleep(1.0); button(KEY_C)` types 'ab', waits 1s and types 'c'
#### repeat(action)
Turbo / rapid fire mode. Repeats macro (or even single action) until physical button is released. Macro is always played to end, even if button is released before macro is finished.
- `repeat(button(BTN_X))` deals with "mash X to not die" events in some games.
#### cycle(action1, action2...)
Executes different action every time when button is pressed (action1 upon first press, action2 with second, etc.)
Works only on buttons.
# Examples for profile file
Emulate key presses based on stick position
```
"stick" : {
"X" : { "action" : "pad(KEY_A, KEY_D)" },
"Y" : { "action" : "key(KEY_W, KEY_S)" },
```
Emulate left/right stick movement with X and B buttons
```
"buttons" : {
"B" : { "action" : "axis(ABS_X, 0, 32767)" },
"X" : { "action" : "axis(ABS_X, 0, -32767)" },
```
Emulate dpad on left touchpad, but act only when dpad is pressed
```
"left_pad" : {
"action" : "click( dpad('hatup(ABS_HAT0Y)', 'hatdown(ABS_HAT0Y)', 'hatleft(ABS_HAT0X)', 'hatright(ABS_HAT0X)' ) )"
}
```
Emulate button A when left trigger is half-pressed and button B when
it is pressed fully
```
"triggers" : {
"LEFT" : { "action" : "pad(BTN_A, BTN_B)" },
```
C0rn3j-sc-controller-f3b142b/docs/menu-file.md 0000664 0000000 0000000 00000004415 15226114475 0021110 0 ustar 00root root 0000000 0000000 SC Controller menu file specification
----------------------------------------
Menu file contains json-encoded list with menu items (actions), submenus,
separators and menu generators.
### Menu Items
Every menu item is defined by action, in same way as action would be defined
[in profile file](profile-file.md#Action_definition) with one additional
`id` key. `id` specifies action ID and can be anything, but each menu item
should have unique ID.
`name` key is still optional, but highly recommended as used as menu item title
displayed on screen. If `name` is not specified, title is auto-generated.
Example:
[{
"id": "item1",
"action": "profile('Desktop')",
"name": "Switch to Desktop profile",
}, {
"id": "item2",
"action": "turnoff()",
"name": "Turn controller OFF",
}]
specifies menu with two items.
### Submenus
Submenu is reference to another menu file (submenu cannot be defined in same
file or profile file). When selected, another menu is loaded and drawn over
original menu.
Submenu is dict with `submenu` key, value of key is filename relative to
`~/.config/scc/menus` or `/usr/share/scc/default_menus/`, whichever exists, in
that order.
`name` key may be defined.
Example:
[{
"submenu": "profiles.menu",
"name": "All Profiles"
}]
specifies menu with sumbmenu called "All Profiles" defined in *profiles.menu*
### Separators
Separator is empty space that splits menu into two or more logical blocks.
Name, if set, is displayed in different way from menu items. Separator is
defined by dict with `separator` key set to True.
### Menu Generators
Generator is something that generates menu items automatically. It is defined
by dict with `generator` key, where value is type of generator to use.
Example:
[{
"generator": "profiles"
}, {
"id": "item2",
"action": "turnoff()",
"name": "Turn controller OFF",
}]
specifies menu with list of all profiles, followed by one normal menu item.
### Available generators
#### `profiles`
Generates menu item for each available profile. Selecting item will switch to
represented profile.
#### `recent`
Generates menu item for *X* recently selected profiles. *X* is 5 by default and
can be set with additional `rows` key.
C0rn3j-sc-controller-f3b142b/docs/osd-keyboard.png 0000664 0000000 0000000 00000106510 15226114475 0021775 0 ustar 00root root 0000000 0000000 PNG
IHDR 7 pHYs + tIME53tp/ iTXtComment Created with GIMPd.e IDATx읅HGD0;q|e&x.XnU~zE3*͉rRA~KKUW]%gezN~ɉѡu]y啶m* ,I;t 2_-sÈ9##4 ci??9?!h###âh}}}۷oK+4]Z9D*1 `9<+]F|7GeO?}7>?c!2BEEٺuX_Γ1̷ XҪժQ4 K3r6f÷,~=EEۼysVK,T :O<`)Vv, k`M93>{ M#gca:-Jgp~PmٲEmÆ
A\vebi$ qYD*W/ `IoSAUU*b \i6ySD- J16Qj!BH4%McM7B!,kQ3h]Sqy,mA rR,
zK9h]S\]58B!dqY.Z?=Tq5,C!Ksg-mXZ!BߣO7]z<Ks'zK#B
Rww><,M&j\F!-Ou4^v1㚇CTᡇWaGrxzkw+rŲ].^|}e6Q#K;
uꌦO1+E/z5kVgG_g}[8G;Kl$W;fwcK{KR5'/Ez
҂
n,-wB\5jW^{
aiKXVY+3Bݠ?Phm2QE/zE腥2Tjs={zV5F/z+z4,eE/,-.$3Ej'vSϿq]*mi:XEҰ4D*/&}?S/Wkʑ`i4,e֦r"jtKy.tVeo,^W`iXˊ^Xښdvm2WwhXNe-wE,K腥ai,ȬIeCtg*ST '4zы^XƲzaiצKhQ;DiQ4zы^XƲ zaiV)+ax^E/,
KcYUkRFyOg]
K腥ai,8Q[0NSeE
K腥ai,rurVqZ"Sv-jXE/,
KcYĪsiI{^^XڪWSiEs #
pl۶ҩtm۶m۶mF'zɼtMavJ#b"XX\C^ya^(eM?|߷?xPm\aRƤ_$}l߮x-/dp'#wJ#esz;A~ 66)~=}yڵ4/PW23x}279
(pw.ykxr VVщYmm7RjfZ^1
<|HҀ*f~Q&)e|/uQcOnaK56NK vp(TlQQNOvL"bbuu=566U $ mlN>4
NONi |7Q×Ҡ#UU]&&)BB<<~jj1Ԫa`0%_hYoLOOGGW*)Eqs &Ն3gtpM::IJ#)Çճ齽}:V``rtzz=u?")b::ė՚5?khB'uo[S=rĨ]ф
-L\vm95E-P"R8))Dw:qB+9={nA32249@itaxY{Gk۶m۶m۶mcm9Mϗ*젧$Uy5-KpNJwJr6_ 7?˫Nӌܺ<$?9N[h {JӁiOfuh/*z-8\^B!x?4w@͡e_Qs
{P4sU0S{}}+IS9wczj\:u9ztwӊ|& ᄏjF /~M| eʔb l'˕e\%n*^zϿvQZJгţV./e8u>8JwvȆ
OBcH3/116d|_=Pڳ})!!bF=W!ŔƯIS\iE:(iW٠v:c_Z
}fcf2HJ]}u\-t.JhG
P3g?\ye3Pŏ#aI;Di=:x|vaH3;O L)TQ?B%{f)
{o6u8-VU!zj\qES>Xn!N]-^Hҹ4#s@xGޒc-pZDi$ OiTtQVuXs;.Kojwr:v*N9s4C-x@DSR3/L3ͯ#8]͚ZQq#Y*5r6E.Oa`4vM6"FVF~0j<>trJU
:]JRݲ@HzJV́ܔW=hvyO+j> ԭ;*!h5~ul*MHE-י$E0O3rٲ
Ε*PZ)SAU%[]']MbŗDi>3wb%n<mO=!U-S2iK5a29QD2Ni Wʴ裡Zri+ɴZv2=O-
;Rl$Bi 뮻%ES=TtǨ顩G47RJi(QkIixdUݚVȤD
#%!WY;$mi]p'M$r_`Jγ.)I*OOi'
mݎwEgyPZ(6.mGa%j5o&m0S-|BkN*`hqJJd#3Ϭ]6o>~t.UM#HՄiWp9zhj<]Oitm#"5-
TGɟwlsY4Ʀj㮵.kFު瓋ӊ74d#hS8+vArʕHGvl'FĎӚ\(mSZʕ[(Oi{:*fV{HWbVrqG;*/xJ+IRn,SJ$Щ4L١4C&;slܚV\0i*Yӧ !]h.v®O?W?|.DH%Ҙ5}i;Ô{ U[@SZ /c F2ll\Am۪1ה!W:˔&,}a١4uQrnSgeι$)ӱ~ MAFsϭOSF"wy祕QU08խgCͶ3N_Bf)#K}"sfF(WJ#8VN-
h?D#t!tQM7szƳl)4RӌG(Sb g8nW*B6XVFwOf)Xr9<40-S#k=x%\PL0gΗԄ { SFjƓtXEҊjp>dƯ>HjwIf 14bC&]"z}CF(M}xvkdgժ}_,TTed=PP]?VHr4OihM|PrJ:MidY=@7
$i+w)lA1["ęT0NNΖ1
k>V:iL{(sxJ+D>|a<`+o9I+U(c]Q>)F!,I%$ƃ&q8p ߚeJnǩZ-Vpc6tn |