Giter Club home page Giter Club logo

Comments (10)

SUPERCILEX avatar SUPERCILEX commented on September 21, 2024

I'm going to guess that this is a gnome 45 bug, because it works fine for me.

from gnome-clipboard-history.

timo-a avatar timo-a commented on September 21, 2024

It seems to be an issue with the keyboard layout!? The bug only happens with German (Neo, QWERTZ) but the regular German has no issue.

from gnome-clipboard-history.

SUPERCILEX avatar SUPERCILEX commented on September 21, 2024

Oh, no that's definitely my fault. Pasting is super hacky and works by creating a virtual keyboard and then executing key presses.

Our key presses are Shift + Insert, so it must be that the neo layout remaps the insert key (I'd be surprised if shift was moved). Not sure how to fix this though. Maybe there's an API to set the language of the keyboard?

from gnome-clipboard-history.

timo-a avatar timo-a commented on September 21, 2024

Oh, then I closed it prematurely.
I have linked this issue here to the neo keyboard layout repo: https://git.neo-layout.org/neo/neo-layout/issues/650. I have no idea what's going on here, but I hope both parties can somehow get to the bottom of this.

from gnome-clipboard-history.

SUPERCILEX avatar SUPERCILEX commented on September 21, 2024

Can you ask him where I can find the key codes for notify_key? I don't know what numbers map to shift and insert (and I find any information on what a key is supposed to be).

from gnome-clipboard-history.

timo-a avatar timo-a commented on September 21, 2024

So, per the other guy: the keycodes are in /usr/include/linux/input-event-codes.h where
KEY_LEFTSHIFT is 48 and
KEY_INSERT is 110.
"clutter" seems to add the number 8 to them, making the result align with /usr/share/X11/xkb/keycodes/evdev (or the output of xev).

from gnome-clipboard-history.

SUPERCILEX avatar SUPERCILEX commented on September 21, 2024

Ok, can you try applying this patch:

Subject: [PATCH] Use linux key codes for pasting
---
Index: extension.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/extension.js b/extension.js
--- a/extension.js	(revision e46f78e7e82b8eec6d591e2a8ace2e1e9077c4f6)
+++ b/extension.js	(revision b0c198d1e9fb1095ee1d8a36586189d63e54d9ec)
@@ -616,25 +616,28 @@
     this._pasteHackCallbackId = Mainloop.timeout_add(
       1, // Just post to the end of the event loop
       () => {
+        const SHIFT_L = 42;
+        const INSERT = 110;
+
         const eventTime = Clutter.get_current_event_time() * 1000;
-        VirtualKeyboard().notify_keyval(
+        VirtualKeyboard().notify_key(
           eventTime,
-          Clutter.KEY_Shift_L,
+          SHIFT_L,
           Clutter.KeyState.PRESSED,
         );
-        VirtualKeyboard().notify_keyval(
+        VirtualKeyboard().notify_key(
           eventTime,
-          Clutter.KEY_Insert,
+          INSERT,
           Clutter.KeyState.PRESSED,
         );
-        VirtualKeyboard().notify_keyval(
+        VirtualKeyboard().notify_key(
           eventTime,
-          Clutter.KEY_Insert,
+          INSERT,
           Clutter.KeyState.RELEASED,
         );
-        VirtualKeyboard().notify_keyval(
+        VirtualKeyboard().notify_key(
           eventTime,
-          Clutter.KEY_Shift_L,
+          SHIFT_L,
           Clutter.KeyState.RELEASED,
         );
 

from gnome-clipboard-history.

SUPERCILEX avatar SUPERCILEX commented on September 21, 2024

I've been running that solution for a while now and it works fine (be5d98c), so closing.

from gnome-clipboard-history.

timo-a avatar timo-a commented on September 21, 2024

It's working for me as well! Sorry I didn't find the time to test your patch, but I just tried the latest version and can now confirm that it works. Thanks for taking care of this issue even though it turned out to affect a rather small set of users!

from gnome-clipboard-history.

SUPERCILEX avatar SUPERCILEX commented on September 21, 2024

Awesome!

from gnome-clipboard-history.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.