Opened 4 years ago

Closed 4 years ago

#15959 closed enhancement (fixed)

Enable KeymapSwitcher automatically

Reported by: diver Owned by: pulkomandy
Priority: normal Milestone: R1/beta2
Component: - General Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

data/system/boot/first_login/default_deskbar_items.sh

# install KeymapSwitcher for certain locales
if [[ `locale -l` =~ ^(ru|uk|be)$ ]]; then
   /boot/system/preferences/KeymapSwitcher --deskbar
fi

Resolves a TODO https://git.haiku-os.org/haiku/tree/src/apps/firstbootprompt/BootPromptWindow.cpp#n71

Change History (10)

comment:1 by pulkomandy, 4 years ago

Does it need further configuration? Which keymap should be the default then? Also, this wouldn't work in Installer since DeskBar isn't running then, right?

comment:2 by diver, 4 years ago

Yes, by default only current keymap is added to KeymapSwitcher. So it needs additional configuring. KeymapSwitcher icon in the Deskbar should give a visual clue where to do that.

message /boot/home/config/settings/Switcher

BMessage('pref') {
        version = string("1.2.7.11", 9 bytes)
        hotkey = int32(0x2000 or 8192)
        beep = bool(true)
        disabled = bool(false)
        active = int32(0x0 or 0)
        keymaps = int32(0x1 or 1)
        n0 = string("US-International", 17 bytes)
        d0 = int32(0x3f7 or 1015)
        system_wide = int32(0x0 or 0)

We cant't install it without Deskbar running, unless it's possible to insert it here

message /boot/home/config/settings/deskbar/replicants

BMessage(0x0) {
        replicant_path[0] = string("/boot/system/apps/ProcessController", 36 bytes)
        replicant_path[1] = string("/boot/system/apps/NetworkStatus", 32 bytes)
        replicant_path[2] = string("/boot/system/bin/desklink", 26 bytes)
        replicant_path[3] = string("/boot/system/apps/NetPulse", 27 bytes)
        replicant_path[4] = string("/boot/system/bin/vmware_tray", 29 bytes)
        replicant_path[5] = string("/boot/system/preferences/KeymapSwitcher", 40 bytes)

comment:3 by diver, 4 years ago

Ideally we should add current locale's keymap and activate hotkey remapping -- last two lines -- this will avoid configuring KeymapSwitcher altogether.

BMessage('pref') {
        version = string("1.2.7.11", 9 bytes)
        hotkey = int32(0x2000 or 8192)
        beep = bool(true)
        disabled = bool(false)
        active = int32(0x0 or 0)
        keymaps = int32(0x2 or 2)
        system_wide = int32(0x0 or 0)
        d0 = int32(0x3f7 or 1015)
        n0 = string("US-International", 17 bytes)
        d1 = int32(0x3f7 or 1015)
        n1 = string("Russian", 8 bytes)
        remap = int32(0x1 or 1)

comment:4 by diver, 4 years ago

The latter should be fixed on the KeymapSwitcher side https://github.com/HaikuArchives/KeymapSwitcher/blob/master/Settings.cpp#L58

comment:5 by X512, 4 years ago

Is it OK to hardcode calling external component from Haiku code?

comment:6 by pulkomandy, 4 years ago

At some point we will somehow integrate this into Haiku, it's required for normal operation in some locales. Probably the settings will be moved in Keymap or Input preferences.

comment:8 by waddlesplash, 4 years ago

Yes, there is a ticket about integrating it, but currently the way KeymapSwitcher functions is considered a hack. There are blueprints somewhere about how to integrate it properly into input_server, but these are unimplemented.

comment:9 by pulkomandy, 4 years ago

Yes, there is a ticket about integrating it, but currently the way KeymapSwitcher functions is considered a hack.

If we don't integrate it, no one will fix it.

Anyway, patch moved to Gerrit: https://review.haiku-os.org/c/haiku/+/2597

comment:10 by diver, 4 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.