Skip to content

Friday, 3 October 2025

KWin GameController Plugin: Weeks 5-6

It's been another few weeks of progress on the KWin GameController Plugin and I've got a lot to share! After spending the previous weeks setting up the foundation, I've progressed things forward by improving the logic a bit more, creating a few integration tests, integrating it into System Settings, and making sure it runs well on real hardware like the steamdeck.

The primary change was splitting up GameController into two classes. The new one being GenericInputDevice which lives in emulatedInputDevice.{cpp/h}. This allowed me to separate the GameController logic responsible for emulating keyboard and mouse into it's own separate class. Now GameController wrapper class is just responsible for monitoring controller input, resetting idle timer on user activity, and logging.

GenericInputDevice

GenericInputDevice is a class that inherits from InputDevice and is used to emulated Keyboard/Mouse in order to send those inputs through KWins input pipeline. The input_events come from GameController and get processed exactly like they were previously. Each GameController has access to an instance of GenericInputDevice to make its own calls. In the near future I plan on creating a static instance of this class for all GameController to access.

// Inside Gamecontroller construct
 m_inputdevice = std::make_unique<EmulatedInputDevice>();
 KWin::input()->addInputDevice(m_inputdevice.get());

..

// GameController Event Handling Function
void GameController::handleEvdevEvent()
{
 input_event ev;
 for (;;) {
 const int rc = libevdev_next_event(m_evdev.get(), LIBEVDEV_READ_FLAG_NORMAL, &ev);
 if (rc == 0) {
 logEvent(&ev);

 input()->simulateUserActivity();

 if (m_usageCount == 0 || isTestEnvironment)
 m_inputdevice->emulateInputDevice(ev);

.. 

// EmulatedInputDevice
void EmulatedInputDevice::emulateInputDevice(const input_event &ev)
{
 m_ev = ev;
 if (ev.type == EV_KEY) {
 qCDebug(KWIN_GAMECONTROLLER) << "Face button pressed: Simulating User Activity";
 evkeyMapping();
 } else if (m_ev.type == EV_ABS) {
 qCDebug(KWIN_GAMECONTROLLER) << "Analog buttons pressed: Simulating User Activity";
 evabsMapping();
 }
}

void EmulatedInputDevice::evkeyMapping()
{
 bool state = m_ev.value ? true : false;
 std::chrono::microseconds time = std::chrono::seconds(m_ev.time.tv_sec) + std::chrono::microseconds(m_ev.time.tv_usec);

 switch (m_ev.code) {
 case BTN_SOUTH: // A button → Enter
 sendKeySequence(QKeySequence(Qt::Key_Return), state, time);
 break;
 case BTN_EAST: // B button → Escape
 sendKeySequence(QKeySequence(Qt::Key_Escape), state, time);
 break;
 case BTN_NORTH: // X button → Virtual Keyboard
 // TO-DO toggle Virtual Keyboard not working on my distro ( Kubuntu )
 EmulatedInputDevice::toggleVirtualKeyboard(QStringLiteral("forceActivate"));
 case BTN_WEST: // Y button → Space
 sendKeySequence(QKeySequence(Qt::Key_Space), state, time);
 break;
 case BTN_TL: // L button → Ctrl
 sendKeySequence(QKeySequence(Qt::Key_Control), state, time);
 break;
 case BTN_TR: // R button → Alt
 sendKeySequence(QKeySequence(Qt::Key_Alt), state, time);
 break;
 case BTN_START: // START button → Meta
 sendKeySequence(QKeySequence(Qt::Key_Meta), state, time);
 break;
 case BTN_SELECT: // SELECT
 break;
 // Add more button mappings here as needed
 default:
 break;
 }
}

..

Integration Test: Qt Test

Part of the requirements for proposing significant contributions to KWin is creating integration test. This provides some assurance that things, like core functionality of the plugin, won't break so easily in the future as new code gets added. For testing KWin uses Qt Test Framework. It's been fairly simple and straightforward learning how to use the framework to create my own tests. Still, what exactly to test and how to test it was not so straightforward. I learned along the way that I'd be creating integration test instead of unit test. The test don't reference the plugins directly, instead they test the effect of the plugins on the system over all. That meant that things which required an instance of the plugin to test were not possible in this case. That included testing hotplug capability or number of applications that plugin thinks has opened an input device. Thankfully there were a few very important functionalities that could be tested! Those include:

// Test system idle time reset. Prevents suspend
void testResetIdleTime();

// Test Controller To Keyboard Input Emulation
void testKeyboardMapping();

// Test Controller To Pointer/Mouse Input Emulation
void testPointerMapping();

I took a lot of inspiration from the buttonrebind_test.cpp.

System Settings KCM

It was agreed upon early on that this plugin would be opt-in, allowing the user to enable and disable it when they choose. For that I created a KDE Control Module or KCM. Or better put, I built on the existing Game Controller KCM :) I added a new UI element, a toggle, for users to enable and disable the plugin. On the backend I added a Q_PROPERTY, pluginEnabled that is responsible for checking the kwinrc Plugin configs and writing to it for managing the state of this plugin. This is what it currently looks like (subject to change):

game_controller_kcm

Handling Lizard Mode

This was probably one of the most daunting parts of the project for me when I first started. I knew that steamOS had its own way of handling input coming from the steamdeck controller which has nothing to do with KDE or Steam app. This is what allows the controller to work for navigating the device in game and desktop mode when Steam app is closed. It's what is refered to as "Lizard Mode". The controller -> keyboard/pointer rebinds that I implemented was based off of the rebinds of this Lizard mode. Ideally using a controller to navigate desktop feels/works the same across all devices on KDE. It's important that this new plugin not disrupt the current input system for the steamdeck. Originally I was warned that opening the fd for this device would cause Lizard mode to be disabled which would mean I would have to either:

A: Find a way to disable Lizard mode and implement it from scratch..
B: Figure out what disabled Lizard mode on FD open and how to prevent / enable it as needed.
or
C: Just change the flag for opening the controller fd and everything works just fine :)

Yup, that easy. After some testing and the smallest change I've had to make all project, the steamdeck controller was able to be detected by the plugin including its input events! Even better than that, and not sure why I did not put this together before, steamdeck already maps its input to keyboard/mouse. Duh. So this gamepad plugin doesn't need to worry about mapping for steamdeck controller, just use its input events to prevent system sleep when activity from that controller is detected.
During my testing I discovered that steamdeck shows up on the system as 5 different controllers. Each having their own purpose, one to handle analog input (triggers, trackpads, sticks) another to handle face buttons & D-pad, another for keyboard, etc.. These are used by the system depending on the users needs. Again, this made life a lot easier. This are logs from evtest and gamecontroller plugin:

game_controller_steamdeck_testing_0
game_controller_steamdeck_testing_1
game_controller_steamdeck_testing_2

At the start of this project I had adopted a child. Some of you reading this post might have met my child. It's named Bug328987. It had been drifting as part of the KDE community for some time looking for someone to take care of it. But that never happened, and thus time just went on, and on. As some put it:

timonoj: Wow this is an ELEVEN (!) year old bug.

WS: This issue is so old it can go to middle school.

and my favorite

Holmes: Is there any hope that this bug will be fixed before the heat death of the universe?

By the time I met Bug328987 it had been around for ~12 years. But still! In the eyes of KDE, it was a young, bright eyed, workflow breaking bug like all the bugs out there and it had potential to be fixed! After months of back and forth with mentors, living in KDE matrix server like it were my personal Discord server, and learning how to not do things in the code base - I'm proud to say gamecontroller plugin properly addresses Bug328987. Bringing to an end its more than a decade long journey. They grow up so fast.

What’s next from here

  • Integration into Kwin Proper: "Draft" label has been removed from MR and is ready for review.
  • Final Fixes and Touch-up: Get Virtual Keyboard working, KCM toggle hot-plug, improve analog -> pointer emulation.

Reference documentation:

Other useful links: KWin Gamepad Plugin: https://invent.kde.org/yorisoft/kwin/-/tree/work/yorisoft/gamepad-plugin/src/plugins/gamepad

Thursday, 2 October 2025

Beyond Keywords: How I Built a Semantic Search Engine for Any Video Ever tried to find a specific moment in a long video? You might remember the scene vividly—a character gives a crucial speech, or there’s a beautiful, silent shot of a landscape—but you can’t remember the exact timestamp. You end up scrubbing back and forth, wasting minutes, or even hours, trying to pinpoint that one moment. Traditional video search relies on titles, descriptions, and manual tags.

Introduction


From left to right: Jakob Mats Emil Wirén, Bror Wetlesen Vedeld, Aksel Matashev

In Spring 2025, three students from NTNU Gjøvik; Jakob Mats Emil Wirén, Aksel Matashev, and Bror Wetlesen Vedeld, carried out a bachelor’s project hosted by the Qt office in Oslo. Our goal was to investigate how native push notification services could be integrated into Qt applications in a cross-platform manner. The resulting experimental library has been named QtPushNotifications, and refers to the implementation that can be found here https://git.qt.io/nils.petter.skalerud/qtpushnotifications. Do note that, at the time of writing, there are no current plans to integrate this functionality into Qt as an official feature, this project was primarily done for research purposes.

We are happy to announce the release of Qt Creator 18 Beta2.

The v0.9.6 release adds support for GPT-5 and GPT-OSS to the Qt AI Assistant. GPT-5 increases the QML coding performance by 12% compared to GPT-4o. GPT-OSS 20B is the first royalty-free LLM for prompts that developers can host on their own computer.

Some important features and changes included in 6.5 beta are highlighted on KDE community wiki page.

View full changelog

Wednesday, 1 October 2025

Design Systems is a relatively new concept that aims to organize the way design happens in structured systems such as applications, websites, organizations, etc.

Historically, working with graphics for the digital age has been unorganized, lives in personal computers, is not collaborative and leads to uncoordinated design.

When the world of graphic design meets development, designers were often confused about why mockups are not followed, why colors are not the same, not the same shapes, etc. All the while, developers ask designers why they can’t provide something that more closely resembles the system they aim to change. It’s uncoordinated work entering a highly-systemized world.

Often, both sides are confused and system changes become much more difficult to achieve.

Meet UI-design applications. The first wave of these started with Sketch (for Mac). Sketch is a fast and powerful vector graphics application that introduced a number of advantages over traditional SVG editors meant for artistic work. For example:

  • Infinite canvas
  • Area bounding
  • CSS-based design
  • CSS-based organization
  • Easy exports into various sizes
  • Asset library management
  • Collaborative design

Through their efforts, a sleuth of similar applications appeared in the scene, one building upon what the previous one lacked. Until we arrived at Figma, yes, Figma.

Figma did a few things right at the start of their development. They provided stronger asset library management, easier online collaboration, web-based editor with near-native speeds (If not faster now with the use of Web Assembly and other technologies), and variable and token management.

Through these enhancements Figma became the de-facto application to use for UI-oriented graphic development.

But what do they all do?

Put simply, these applications develop color, typography, spacings, shadows, icons, etc sets of organized assets. The assets have properties borrowed from development, such as, components, variables and tokens.

Designers can set up entire color libraries in a graphical way and then apply those colors to SVG graphics. Upon export, these graphics contain enough information for developers to more easily implement the design.

All the while, designers only have to spend time at the beginning of a project to set up all the assets required for designing. Additionally, Figma and other applications have been keenly focused on building graphical ways to deal with code-oriented complexities.

For example, Figma and PenPot detect variants creation and can express their values in dropdown menus that get created on the fly by the designers. If you create a button and your variants are size oriented, you can have a dropdown in the application’s UI that shows SM, MD, LG, XL, etc. These are huge time savers. Traditionally, designers would have to do a lot of copy/paste in their designs. With integrations like these, designers simply switch the variant for another and the design updates itself.

A similar idea happens with graphical components in these applications. Users are able to create a master version of an asset, let’s say a button, set up all of their locked and open parameters, colors, typography, margins, gutters, etc. When you make copies of this component, any changes made at the component level will be updated anywhere copies were placed. For very large design documents containing a company’s brand strategy, for example, these types of changes save countless hours of tedious copy/paste work.

Tokens

In recent times, and through various changes in the app-making industry, UI design applications have created the concept of tokens. Tokens are essentially named attributes for graphical components. They are often used as correlated language between design applications and systems.

For example, for Ocean Design, the team created tokens named thus:

pd.ref.color.primary50
  • PD: Plasma Design
  • REF: Reference color (Raw color value as opposed to applied color, which is called “sys”)
  • PRIMARY50: Color role and its named color value in a line from light to dark values of the same color family.

This value can be replicated in Plasma. Through the storing of a master list of token values, Plasma can stay coordinated with graphic primary50, the system would have to do the same and just change the raw color value of that token without having to create new tokens, break coordination with the design system, or have to interpret information coming from designers.

Tokens are becoming more common use and reflect the desire of developers and designers to have even tighter integration between design and development.

Independence

Design Systems also allow for great independence between design and development. Having laid the groundwork to create coordinated design, applications like Figma and PenPot allow users to download asset libraries, reuse, and create UI. All without redefining the source library. It democratizes graphic design while keeping designers coordinated in their designs.

Developers looking to execute an application idea can much more easily create coordinate UI that supports their efforts. Developers would have much less design-oriented work to do and dedicate more into the features they want to deliver.

Ocean Design

Ocean Design aims not only to become a new UI design for Plasma but also plug in these powerful design applications into our development ecosystem and deliver UI to users faster, more coordinated, and more often.

If you’re interested in learning more about this effort, connect with our teams here:

  • Plasma Visual Design Team (General chat about all things designs for the Plasma Desktop)
  • Ocean Design Team (Focused discussion on Ocean Design)
We are happy to announce the release of Qt Creator 17.0.2!

This release fixes a range of smaller issues across various areas. Please check our change log for details.

Tuesday, 30 September 2025

Haruna version 1.5.0 is released.

haruna-pl-drag.webp

The highlight of this release is the playlist, which got a lot of features:

  • multiple playlists through tabs (Muhammet Sadık Uğursoy)
  • drag and drop reordering (Muhammet Sadık Uğursoy)
  • add files and folders through drag and drop (Muhammet Sadık Uğursoy)
  • filtering (Muhammet Sadık Uğursoy)
  • option to control playback behavior when a file ends: repeat playlist, repeat file, stop after last file in playlist, stop after current fille and play a random item

Another big change is to the Mouse settings, now you can use a mouse button + modifier key combo (ctrl + left click, shift + scroll up/down etc.).


flathub logo

Windows version:

Availability of other package formats depends on your distro and the people who package Haruna.

If you like Haruna then support its development: GitHub Sponsors | Liberapay | PayPal

Feature requests and bugs should be posted on bugs.kde.org, ignoring the bug report template can result in your report being ignored.


Changelog

1.5.0

Known issues

On Windows the Shortcuts and Custom Commands settings pages don't work.

Features

Settings

  • General
    • added single instance setting to play new file when appending to the playlist
    • removed the "File dialog location setting"
  • Playlist: added settings to control playback behavior
  • Mouse
    • changed to allow modifier keys
    • added support for Mouse Forward and Back buttons
  • Subtitles: if a relative folder name in the Load subtitle from list starts with an * (asterisk) then subtitles will be searched in all folders contaning the folder name. Example: If the Load subtitle from list contains an entry *sub and you have the following folders next to the video file subs, more subs and subtitles all of these folders will be searched.
  • the settings window now has a minimum width and height

PlayList

  • added support for multiple playlists
  • items can be reordered manually through drag and dropdown
  • items can be selected, ctrl+click to select multiple items, shift+click to select a range
  • items can be filtered
  • added setings to control playback behavior when a file ends
  • when saving the playlist the file extension is set to m3u
  • can add files and folders through drag and drop
  • multiple files can be added through the option in the header
  • hide playlist when mouse leaves window while maximized, prevents opening the playlist when moving mouse to another monitor

Playback

  • if a file can't be played now an error is shown and playback stops instead of trying to play the next file (prevents a potential infinite loop when no file in the playlist can be played)
  • can play files starting with a dot (hidden files)
  • an error is shown when failing to get youtube playlist

Other

  • mpris: add support for Shuffle and LoopStatus
  • changed the action selection popup to use Kirigami.SearchDialog
  • replaced the spinning icon with a progress bar and label
  • the drop area of the video is split in 2 parts now
    • top part always appends to the default playlist
    • bottom part clears the default playlist and adds the dropped files and folders, when only one file is dropped it behaves as the open file action (clears the playlist and loads sibling files if enabled in settings)
  • recent files are now stored in a sqlite database
  • time positions used to restore videos are also stored in the database
  • sleep is blocked on Windows too
  • all strings should be translatable now

Bugfixes

  • fixed the loop action, osd was not showing and progress bar was not highlighting the loop range
  • before loading check that the file exists
  • fixed loading wrong subtitles when using recursive subs
  • fixed the progress bar getting taller when the chapters menu becomes visible
  • fixed a bug where the video would pause after clicking the progress/seek bar
10 Years of Qt OPC UA

Beginning of 2025 I was searching through the version history of Qt OPC UA - trying to find out when a certain issue got introduced. At some point I was curious: How long does this thing go back?! Turns out that the first git commit is dated 25th of September 2015. Which means we have been doing this for over 10 years now!

Continue reading 10 Years of Qt OPC UA at basysKom GmbH.