input-remapper icon indicating copy to clipboard operation
input-remapper copied to clipboard

Added automatic stopping and re-starting of injection when recording …

Open sabudum opened this issue 4 months ago • 6 comments

…input.

When hitting the record button to grab inputs for remapping. If the preset is currently running, the program will stop it temporarily until recording finishes, then re-start the injection afterwards.

sabudum avatar Aug 23 '25 18:08 sabudum

Thanks, seems to work well!

After recording something, the "Record" button greys out:

image

It shouldn't do that anymore then, right?

sezanzeb avatar Aug 25 '25 13:08 sezanzeb

Thanks, seems to work well!

After recording something, the "Record" button greys out:

image It shouldn't do that anymore then, right?

Tried to solve that, but couldn't find the cause. You can select a different mapping and the button un-greys, for instance just click on the "b" mapping there and it would un-grey.

Also, editing a mapping with the preset injected, the changes don't reflect immediately, you have to re-inject by re-recording the same button, if you get what I mean. So if you record "H", map it to something, then press Record again, and press H again for it to reload the preset. Otherwise it won't work immediately after remapping it.

sabudum avatar Aug 25 '25 20:08 sabudum

Probaby some usage of set_sensitive controls the recording button. https://lazka.github.io/pgi-docs/#Gtk-4.0/classes/Widget.html#Gtk.Widget.set_sensitive

sezanzeb avatar Aug 25 '25 22:08 sezanzeb

Probaby some usage of set_sensitive controls the recording button. https://lazka.github.io/pgi-docs/#Gtk-4.0/classes/Widget.html#Gtk.Widget.set_sensitive

Figured it would be, but could not find the code where it is being set.

sabudum avatar Aug 25 '25 23:08 sabudum

I this case you could add a print statement above all the calls to set_sensitive and then run the application. The information printed to the console could help you to figure out which call it is.

Once you figured that out, you can use traceback.print_stack() to understand how it is called (Or follow the usage of methods and classes through the code).

Or use a debugger and breakpoints.

sezanzeb avatar Aug 28 '25 08:08 sezanzeb

I this case you could add a print statement above all the calls to set_sensitive and then run the application. The information printed to the console could help you to figure out which call it is.

Once you figured that out, you can use traceback.print_stack() to understand how it is called (Or follow the usage of methods and classes through the code).

Or use a debugger and breakpoints.

I've traced all calls to set_sensitive() There's only one call that disables the Record button. And it is called when no active mapping is selected. My guess is that when the injection starts it clears the selected mapping, but also couldn't find how to solve that.

sabudum avatar Aug 28 '25 17:08 sabudum