Announcement

Collapse
No announcement yet.

keyboard shortcuts in Wayland impossible at present if ever?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    keyboard shortcuts in Wayland impossible at present if ever?

    I was advised to post this in these more general forums - first put into Resolute Racoon Review.

    I am not referring to shortcuts as in links to applications or files/folders.

    I am referring to the issue with Wayland and it's inability to implement a system-wide pasting of completed snippets of text or code to any desktop or activity. Before Kubuntu 24.01 there was a very simple system application to implement this in the system keyboard menu. With the introduction of Wayland, that has been quietly dropped for obvious reasons.

    This has very serious ramifications for many users that are so used to a keyboard shortcut to insert a passage of text, an address, email address or snippet of oft-used code into a document or text.
    The ramifications on the productivity of users so used to this facility is enormous.

    Even in Windows it is a very simple thing to set up.

    This is the primary failing of Wayland and one reason for the massive backlash against it's precipitous introduction. A form of keyboard logging across applications and desktops is required for this to be implemented - the antithesis of the whole philosophy behind Wayland.

    I do not see how it is ever going to be resolved, but if Wayland is to be implemented wholesale across the Linux world we will be driving many workers back into the arms of Microsoft and Apple.

    I sincerely hope this can be overcome in some way. The constant push by Canconical and other developers to prioritise security over function and usefulness is self defeating. Linux is inherently more secure than most other systems, and this constant drive to enhance security over functionality I find absolutely barmy.
    Asus Z270i7 16gb rm 8tb GT1660 Haupp Quad tuner Kubuntu Jammy/Win 11 Be/FE mythtv 0.34Homerun dual netwk tuner 55¨ Smsng QN95B55" Lap Smsng NP R580 i5 nvidia linux Ultimate/Win 10

    #2
    I'm still not clear in what you are taking about here. I can paste any text anywhere, including saved items using klipper, same as it has been. Nothing changed for me as far as I can recall, and I've been on Wayland for at least three, four years, if not longer.

    ctrl-c, ctrl-v, meta-v for the selection pop out, or via the system tray widget.


    In the current Plasma, you even have "bookmarked" snippets that don't get deleted when you clear klipper's history.

    I make use of this as a main part of my workflow for quite a number of years now


    There is along standing bug/missing feature in klipper where it doesn't paste the snippet automatically when selecting it, you need to still use a paste action. This goes back well before Wayland though.


    Unless I am misunderstanding you ( quite possibly).

    What is this system keyboard menu?
    Last edited by claydoh; Mar 29, 2026, 04:49 PM.
    Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
    HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
    HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux

    Comment


      #3
      claydoh I am obviously not explaining it clearly enough for others to understand.

      I am not talking about copy and paste.

      I am talking about a primary repository of snippets of computer code, addresses, telephone numbers, email addresses and any odd bit of text that can be accessed system-wide across and by all applications and pasted into an application with a simple keystroke sequence, Not a temporary store in a clipboard, a permanent easily accessed pasting with a simple ctrl-alt-whatever for instance.

      The security features of Wayland make this an impossibility.

      They used to be stored in files like khotkeysrc, kglobalshortcutsrc, sometimes stored in " /usr/share/kservices5/ServiceMenus/" and "~/.local/share/kservices5/ServiceMenus/"

      I hope I have explained things better this time.

      I don't understand how Klipper can help, Klipper is a 3d printing application?
      Last edited by barfly; Mar 30, 2026, 03:18 AM.
      Asus Z270i7 16gb rm 8tb GT1660 Haupp Quad tuner Kubuntu Jammy/Win 11 Be/FE mythtv 0.34Homerun dual netwk tuner 55¨ Smsng QN95B55" Lap Smsng NP R580 i5 nvidia linux Ultimate/Win 10

      Comment


        #4
        Khotkeys is the missing application. Maybe. And/or keyboard automated tasks, that sort of thing. Khotkeys went away before Wayland as it was unmaintianed, though I am not sure how long ago. It was officially marked deprecated three years ago.

        How were you setting this up, previously, if you can recall? All those config files listed have little to do with the task, on their own, but may be from third party service menus?

        But what you really are looking for is a "text expansion" tool, perhaps.


        Originally posted by barfly View Post
        The security features of Wayland make this an impossibility.
        Nope, not correct
        https://espanso.org/
        https://espanso.org/docs/install/linux/#deb-wayland
        Or maybe keyd , which works in either x or wayland, I use this on a Chromebook for layout fixes, but haven't gotten around to figuring out this sort of config for text, it inserts extra characters or other odd things, but I have not looked at it in a bit. The syntax for this is quite simple overall.

        ydotool and custom kb shortcuts

        and

        https://gitlab.com/cscs/waybinder

        as well as KDE-specific discussion last week here.
        https://discuss.kde.org/t/a-general-...-functionality

        I'd seen mention of using ibus (multilingual text input tools) to do this in Gnome, so I wonder if fcitx (used in Kubuntu and others) can do something similarAsIGoDownAnotherDeepRabbitHole.......


        Not that this helps someone who needs this sort of functionality right now, though.
        Last edited by claydoh; Mar 31, 2026, 01:59 AM.
        Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
        HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
        HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux

        Comment


          #5


          try looking at input-remapper

          with that you can save predefined text to a keyboard shortcut like we used to be able to so with custom shortcuts
          some stuff i did: https://github.com/droidgoo

          Intel® Core™ i7-14700K | 64 GiB of RAM | AMD RX 6800

          Comment


            #6
            Originally posted by skyfishgoo View Post

            try looking at input-remapper

            with that you can save predefined text to a keyboard shortcut like we used to be able to so with custom shortcuts
            And adding a note that this great tool has a decent enough GUI, compared to scripts and old service menus.

            I forget about input-remapper supporting text input, since I have used keyd for remapping purposes for ages as it is part of my small collection of scripts for setting up my Chromebook after installing Linux on it.

            But input-remapper requires either a possibly tedious input for text it seems, or needing a custom script to copy/paste for each snippet.


            Originally posted by barfly View Post
            I don't understand how Klipper can help, Klipper is a 3d printing application?
            Klipper is Plasma's clipboard tool, has been around as long as I have used KDE full time, so at least KDE2, probably longer as I did first use KDE at 1.4-ish

            It can copy text etc, and in the latest Plasma 6.6 (in 26.04) it can save 'starred' items that won't be removed when clearing.

            I use this over a text expander-type of tool as I do use a decent amount of saved snippets, but these are not static, and change quite often.
            Last edited by claydoh; Mar 31, 2026, 05:01 AM.
            Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
            HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
            HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux

            Comment


              #7
              Espanso I found very convoluted and not really suitable, it doesn't have the same functionality, plus a massive learning curve when my old brain is full up with other stuff learned over the last 75 years...

              Input remapper looks even more complicated. I thought things with computers were supposed to get easier, not harder as time goes on?

              I cannot find any reference to Klipper anywhere other than as a 3D printer application. It is not in any repository I have looked and internet searches only show the 3D application.
              Asus Z270i7 16gb rm 8tb GT1660 Haupp Quad tuner Kubuntu Jammy/Win 11 Be/FE mythtv 0.34Homerun dual netwk tuner 55¨ Smsng QN95B55" Lap Smsng NP R580 i5 nvidia linux Ultimate/Win 10

              Comment


                #8

                My last question still stands: How were you setting shortcuts for this before?
                Can you give an example?

                That may lead to what needs to be done, just using different tools.



                Klipper is the clipboard manager in Plasma -it sits in your system tray.

                Click image for larger version  Name:	Screenshot_20260404_034734.png Views:	0 Size:	58.2 KB ID:	691154

                It may not be actually called klipper anywhere visible these days, but it has been referred to it by that name for close to 30 years or more. It is not so much a standalone thing like it was back in the day.

                https://www.howtogeek.com/kde-plasma...s-one-feature/
                https://userbase.kde.org/Klipper
                https://invent.kde.org/plasma/plasma...ref_type=heads
                https://en.wikipedia.org/wiki/Klipper


                This is what it looks like in Plasma 6.5

                Click image for larger version  Name:	Screenshot_20260404_041520.png Views:	0 Size:	260.5 KB ID:	691155Click image for larger version  Name:	Screenshot_20260404_041416.png Views:	0 Size:	171.8 KB ID:	691156
                Pretty much the same as Plasma 6.5 and earlier, but with saved items.
                Last edited by claydoh; Apr 04, 2026, 02:23 AM.
                Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
                HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
                HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux

                Comment


                  #9
                  claydoh Thanks for your continued persistence with this it is very gratifying. you ask "My last question still stands: How were you setting shortcuts for this before?
                  Can you give an example?


                  I no longer have any installed o/s's such as 16.04 which have the old khotkeys which is the really brilliant little tool that KDE had, so I cannot show you how great it was.

                  I now understand what you mean by Klipper. I have looked at it in detail but I cannot see a way to insert SAVED snippets locked to a keystroke sequence available on all desktops/screens and all applications. Even with the extended menus, there is nowhere to achieve what was so easy with khotkeys.

                  Every application I look at studiously avoids the very thing that most users find indispensable, how to simply map a text block of SAVED text to a keyboard sequence. Nothing I have looked at so far does it.

                  The only thing that comes close is Autokey, and that does not work on Wayland, as I stated before, nothing can work because the whole ethos of Wayland is to sandbox the keyboard into little compartments that cannot be shared between screens or applications.
                  You stated earlier that is not true, and pointed out an extremely complicated messy way that it may achieve this, you lost me in the first few stansas.. How do you expect new converts to Linux will be able to do this?

                  I have looked at keyd and ydotool, both are extremely complicated to implement to achieve a simple task. If Autokey could be ported to Wayland that would be ideal, but wayland specifically excludes any trans-application trans-window usage, that is the whole point of Wayland.

                  So I'm really sorry, none of your solutions comes anywhere close to khotkeys. Espanso does come closer than the others, but is very difficult to set up.

                  Until this hurdle is overcome in an easily newbie-orientated way, then there will be many would-be converts to Linux driven away.

                  Once again, thank you for your input, it is very much appreciated.
                  Last edited by barfly; Apr 05, 2026, 04:24 AM.
                  Asus Z270i7 16gb rm 8tb GT1660 Haupp Quad tuner Kubuntu Jammy/Win 11 Be/FE mythtv 0.34Homerun dual netwk tuner 55¨ Smsng QN95B55" Lap Smsng NP R580 i5 nvidia linux Ultimate/Win 10

                  Comment


                    #10
                    Yes, but how did you do this with khotkeys? Even a rough example might point how to do it in the current shortcut tool.



                    But, I thought autokey was a text-config based tool, loke esspanso
                    Keyd IS text based, but overall a lot simpler

                    Code:
                    [meta]
                    f1 = macro(my.email.com)​
                    BUTT autokey has a GUI, I discovered.
                    AND it has GUIs.
                    Unfortunately, it has Wayland support , but it needs to be compiled, and I don't see anyone offering a PPA or repo with pre-release packages.
                    (the last autokey official release was in 2022, if that tells you anything)
                    Reading their github issues and discussion, it seems like it is working, but no idea how long before an official release/

                    There is a fork of it, with Wayland, and specifically KDE support, if you are adeventuous.

                    https://github.com/dlk3/autokey-wayland

                    installation:

                    https://autokey-wayland.readthedocs....st/ubuntu.html

                    just substitute autokey-qt in place of -gtk

                    It is working for me, in brief testing.




                    Click image for larger version

Name:	Screenshot_20260405_083105.png
Views:	0
Size:	338.6 KB
ID:	691159
                    Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
                    HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
                    HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux

                    Comment


                      #11
                      the input-remapper macro language is a bit finicky, but it is more than up to the task of doing what you want to do.

                      i can map ctrl+shift+p to the following macro and have it enter my webpage URL into any text box

                      Code:
                      modify(shift_L,key(p)).key(u).key(t).
                      modify(shift_L,key(p)).key(e).key(o).key(p).key(l) .key(e).
                      modify(shift_L,key(o)).key(v).key(e).key(r).
                      modify(shift_L,key(p)).key(r).key(o).key(f).key(i) .key(t).
                      key(KEY_DOT).key(o).key(r).key(g).
                      key(KEY_ENTER)​
                      so now when i hit ctrl+shift+p on my keyboard i get

                      PutPeopleOverProfit.org
                      some stuff i did: https://github.com/droidgoo

                      Intel® Core™ i7-14700K | 64 GiB of RAM | AMD RX 6800

                      Comment


                        #12
                        i made a little bash script to help write input-remapper macro's since it is kinda tedious.

                        it can handle all the regular keys and their shifted variants

                        i requires kdialog for the i/o which most kubuntu users should have installed.

                        Code:
                        #!/bin/bash
                        #uncomment the next line for diagnostic help.
                        # set -x
                        
                        #this will take written input and write an input-remapper macro to produce
                        #the exact same string which can be mapped to a keyboard shortcut
                        
                        textIn=$(kdialog --textinputbox "write the desired macro output" "Hello, World!")
                        len=${#textIn}
                        macro=""
                        
                        for (( i=0; i<$len; i++)) ; do
                        
                            ch=${textIn:$i:1}
                        
                        #covers upper&lower case and a few punctuation characters, or exits if not listed
                            case $ch in
                                [a-z] | [0-9])
                                    macro="$macro key($ch)."
                                    ;;
                                [A-Z])
                                    macro="$macro modify(shift_L,key($ch))."
                                    ;;
                                \`)
                                    macro="$macro key(KEY_GRAVE)."
                                    ;;
                                \~)
                                    macro="$macro modify(shift_L,key(KEY_GRAVE))."
                                    ;;
                                !)
                                    macro="$macro modify(shift_L,key(1))."
                                    ;;
                                @)
                                    macro="$macro modify(shift_L,key(2))."
                                    ;;
                                \#)
                                    macro="$macro modify(shift_L,key(3))."
                                    ;;
                                $)
                                    macro="$macro modify(shift_L,key(4))."
                                    ;;
                                %)
                                    macro="$macro modify(shift_L,key(5))."
                                    ;;
                                ^)
                                    macro="$macro modify(shift_L,key(6))."
                                    ;;
                                \&)
                                    macro="$macro modify(shift_L,key(7))."
                                    ;;
                                \*)
                                    macro="$macro modify(shift_L,key(8))."
                                    ;;
                                \()
                                    macro="$macro modify(shift_L,key(9))."
                                    ;;
                                \))
                                    macro="$macro modify(shift_L,key(0))."
                                    ;;
                                -)
                                    macro="$macro key(KEY_MINUS)."
                                    ;;
                                _)
                                    macro="$macro modify(shift_L,key(KEY_MINUS))."
                                    ;;
                        ​        =)
                                    macro="$macro key(KEY_EQUAL)."
                                    ;;
                                +)
                                    macro="$macro modify(shift_L,key(KEY_EQUAL))."
                                    ;;
                                [)
                                    macro="$macro key(KEY_LEFTBRACE)."
                                    ;;
                                {)
                                    macro="$macro modify(shift_L,key(KEY_LEFTBRACE))."
                                    ;;
                                ])
                                    macro="$macro key(KEY_RIGHTBRACE)."
                                    ;;
                                })
                                    macro="$macro modify(shift_L,key(KEY_RIGHTBRACE))."
                                    ;;
                                \\)
                                    macro="$macro key(KEY_BACKSLASH)."
                                    ;;
                                \|)
                                    macro="$macro modify(shift_L,key(KEY_BACKSLASH))."
                                    ;;
                                \;)
                                    macro="$macro key(KEY_SEMICOLON)."
                                    ;;
                                :)
                                    macro="$macro modify(shift_L,key(KEY_SEMICOLON))."
                                    ;;
                                 \')
                                    macro="$macro key(KEY_APOSTROPHE)."
                                    ;;
                                \")
                                    macro="$macro modify(shift_L,key(KEY_APOSTROPHE))."
                                    ;;
                                ,)
                                    macro="$macro key(KEY_COMMA)."
                                    ;;
                                \<)
                                    macro="$macro modify(shift_L,key(KEY_COMMA))."
                                    ;;
                                .)
                                    macro="$macro key(KEY_DOT)."
                                    ;;
                                \>)
                                    macro="$macro modify(shift_L,key(KEY_DOT))."
                                    ;;
                                 /)
                                    macro="$macro key(KEY_SLASH)."
                                    ;;
                                \?)
                                    macro="$macro modify(shift_L,key(KEY_SLASH))."
                                    ;;
                                 ' ')
                                    macro="$macro key(space)."
                                    ;;​
                                *)
                                    echo "$ch is not allowed"
                                    exit 1
                                    ;;
                            esac
                        
                            ((n++))
                            if [[ $n -gt 3 ]] ; then
                                macro=$macro"\n"                #keeps output to reasonable line lengths
                                n=0
                            fi
                        
                        done
                        
                        kdialog --textinputbox "copy the result and paste it\ninto input-remapper's output box" "$macro"
                        
                        ​
                        Last edited by skyfishgoo; Apr 05, 2026, 07:43 PM.
                        some stuff i did: https://github.com/droidgoo

                        Intel® Core™ i7-14700K | 64 GiB of RAM | AMD RX 6800

                        Comment

                        Users Viewing This Topic

                        Collapse

                        There are 0 users viewing this topic.

                        Working...
                        X