Skip to content

Hotkeys are keyboard layout dependent #45

Closed

Description

@K900

For example, pressing 'F' when a Russian keyboard layout is used will result in 'А' (Cyrillic), and mpv will not accept that as a hotkey.

Activity

  1. K900 commented on Mar 16, 2013

    @K900
    Author

    I do use an ASCII layout, but I have to switch between Russian and ASCII (US English for me). What I was talking about is maybe allowing scancodes or some solution that is completely keyboard layout agnostic.

  2. K900 commented on Mar 16, 2013

    @K900
    Author

    Scancodes should work on any keyboard, or at least any HID compliant one.

  3. divVerent commented on Mar 16, 2013

    @divVerent
    Member

    On Sa., 16. Mär. 2013 18:02:00 CET, wm4 notifications@github.com wrote:

    I wonder if there's a way to force a different keyboard layout for a
    specific window? Or maybe it would be possible to run some sort of
    daemon, which switches the keyboard layout based on the foreground
    window?

    I know at least GNOME can do this, as well as Windows.

    However, in GNOME's case it may be necessary for the application to support it. Have not tried it it works for mpv.

  4. K900 commented on Mar 20, 2013

    @K900
    Author

    Sorry for lagging behind, I ended up just adding mappings for Cyrillic
    chars and doing some KWin magic to make sure IMEs stay off with mpv. Still
    this is a thing that should be considered, IMHO, because setting the
    hotkeys twice (or more) is tedious and not immediately obvious. I'll try to
    put together a scancode based patch in a few days/weeks/when I have time.

    2013/3/19 wm4 notifications@github.com

    K900, does any of this help?

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/45#issuecomment-15088714
    .

  5. K900 commented on Mar 20, 2013

    @K900
    Author

    Yeah, that's the main problem I've run into. Also had some fun with trying
    to get mpv to at least build with the Android NDK, but it seems a no-go for
    now.

    2013/3/20 wm4 notifications@github.com

    I'll try to put together a scancode based patch in a few days/weeks/when I
    have time.

    Looking at it myself, it didn't seem easy (you'd have to drag around both
    keycode and scancode or so), but I'm looking forward to your patch.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/45#issuecomment-15195722
    .

  6. K900 commented on Mar 20, 2013

    @K900
    Author

    Bionic isn't really broken, it doesn't have some stuff glibc has, but
    someone could get mplayer running on it without too much problems a while
    ago, and I haven't run into too many breakages right now. The main problem
    is going to be the UI though.

    2013/3/20 wm4 notifications@github.com

    Also had some fun with trying
    to get mpv to at least build with the Android NDK, but it seems a no-go for
    now.

    Since I don't have any Android device, I never tested if it works on
    Android. Since Android's libc is completely broken from what I hear, I can
    see problems cropping up. Also, it's likely that the only VO that works on
    Android is vo_sdl (requires SDL 1.3/2.0).

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/45#issuecomment-15196587
    .

  7. K900 commented on Apr 2, 2013

    @K900
    Author

    Ouch. I think the spam filter ate the previous email. I've set it up with
    another map for Cyrillic characters for now, so that (obviously) works.
    Haven't worked on the patch at all, don't have any free time now...
    02.04.2013 2:36 пользователь "wm4" notifications@github.com написал:

    Ping?

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/45#issuecomment-15741630
    .

  8. ghost closed this as completedon Apr 27, 2013
  9. pbaykalov commented on Oct 11, 2023

    @pbaykalov

    Is there anyway to script keyboard layout change after launching MPV? That would be most convenient way to deal with it at least for Windows which has keyboard layout state for each program (basically).

  10. barsikus007 commented on Jan 15, 2024

    @barsikus007

    I made workaround for my usecase
    This is python script to patch default input.conf values

    input_bindings = """"""  # paste here from https://github.com/mpv-player/mpv/blob/master/etc/input.conf
    
    eng = """~QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>?`qwertyuiop[]asdfghjkl;"zxcvbnm,./"""
    rus = """ЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,ёйцукенгшщзхъфывапролджэячсмитьбю."""
    for line in input_bindings.splitlines():
        if not line.startswith("#"):
            continue
        keybind, *rest = line.split(" ", 1)
        if keybind == "#":
            continue
        keybind = keybind[1:]
        keys = keybind.split("+")
        new_keys = [key.translate(key.maketrans(eng, rus)) if len(key) == 1 else key for key in keys]
        if new_keys == keys:
            continue
        print("+".join(new_keys), next(iter(rest), ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions