Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiles in Keyboard Manager #1881

Open
saahmedm opened this issue Apr 2, 2020 · 19 comments
Open

Profiles in Keyboard Manager #1881

saahmedm opened this issue Apr 2, 2020 · 19 comments
Labels
Idea-Enhancement New feature or request on an existing product Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager

Comments

@saahmedm
Copy link
Contributor

saahmedm commented Apr 2, 2020

Have both predefined profiles (e.g. mac/linux/etc) available to user, and also allow the user to create custom profiles.
Provide a quick way to switch between profiles.

@snorlaxjones
Copy link

What's the status of this feature?

@crutkas crutkas removed this from the 2020 Stability Release milestone Dec 7, 2020
@enricogior enricogior added Idea-Enhancement New feature or request on an existing product and removed Issue-Feature A planned feature addition to a product labels Feb 27, 2021
@freshone
Copy link

This would be a big improvement. I'm curious if you've considered a simple text file import/export feature as a first iteration, as mentioned in #4452. This would be less effort to implement and provide a lot of the benefits.

It also provides benefits that the profile feature doesn't

  • Makes sharing settings across systems and with others easy
  • Creating/editing a large number of mappings (more than 5) as text is easier than using the UI
  • PowerToys already targets power users, which want and expect this kind of control
  • Extending this across PowerToys would probably be straightforward as well

@vmiheer
Copy link

vmiheer commented Jul 19, 2021

Even better would be have profiles tied to keyboard ID (I am hoping app could query usb/bluetooth properties of keyboards).

@jonchun
Copy link

jonchun commented Aug 11, 2021

@freshone I did a little bit of digging in the source because I found it hard to believe it wasn't already already set up that way. It will take a little bit of digging, but as far as I can tell, if you navigate to

C:\Users\jchun\AppData\Local\Microsoft\PowerToys\Keyboard Manager

you should see json files and editing/switching them should be fairly straightforward

@drandarov-io
Copy link

For example, this would be amazing for temporarilty turning these keys into a numpad on TKL keyboards.
image

@Jolt151
Copy link

Jolt151 commented Dec 16, 2021

@jonchun Thanks for pointing to the location where the settings file is stored. This should be added in the documentation, as it is also a partial solution to #4452

@ImCoKeMaN
Copy link

ImCoKeMaN commented Aug 20, 2023

After reading the above comments, I took a shot at making a simple powershell GUI selector for profiles based on this list box code:
https://learn.microsoft.com/en-us/powershell/scripting/samples/selecting-items-from-a-list-box?view=powershell-7.3
and plopping the below code block toward the end. Hopefully this is useful to anyone else wanting to select different profiles easily, and as you can see it's based off previous work, so here's my incremental addition while we wait for an integrated solution

#get all json files other than settings and default from keyboard manager folder
$ErrorActionPreference = 'SilentlyContinue'
cd $HOME
cd '.\AppData\Local\Microsoft\PowerToys\Keyboard Manager'
$profiles = dir *.json | select Name |Where-Object {$_.name -ne "settings.json" -and  $_.name -ne "default.json"}

#Create backup of default.json first run
$bak = '.\default.json.bak'
if (!(test-path $bak)){
    echo "making backup $bak"
    cp default.json $bak
}

#build list box 
foreach ($profile in $profiles)
{
    [void] $listBox.Items.Add($profile.name) 
}

$form.Controls.Add($listBox)
$form.Topmost = $true
$result = $form.ShowDialog()

#act on result copy selected json file over default.json and restart keyboard manager
if ($result -eq [System.Windows.Forms.DialogResult]::OK)
{
    $x = $listBox.SelectedItem
    $x
    cp $x default.json
    taskkill /F /IM PowerToys.KeyboardManagerEngine.exe
    & 'C:\Program Files\PowerToys\modules\KeyboardManager\KeyboardManagerEngine\PowerToys.KeyboardManagerEngine.exe'
}

@sba923
Copy link

sba923 commented Oct 16, 2023

Exporting the mappings to a file so that they can be imported (merged!) into another system's mappings is a must-have if you ask me. Especially for painful-to-configure mappings that use keys that are not easy to find in the drop-down listboxes.

@dolodobendan
Copy link

I'd really like to see this feature in the near future. Or yesterday.

@CattronC
Copy link

CattronC commented Jan 7, 2024

Have both predefined profiles (e.g. mac/linux/etc) available to user, and also allow the user to create custom profiles. Provide a quick way to switch between profiles.

I hope to see this one VERY SOON! Pretty please!

@j824h
Copy link

j824h commented Jan 15, 2024

The feature already exists in Karabiner-Elements for macOS.
https://karabiner-elements.pqrs.org/docs/manual/operation/profiles/
https://github.com/pqrs-org/Karabiner-Elements
It seems we can take something from them.

@hermoron
Copy link

What is the status of this feature?

@therealpeterhua
Copy link

Pinging on this as well. Big pain

@tmac213
Copy link

tmac213 commented Aug 24, 2024

I am also in need of this feature. Seems like a simple add.

To clarify: I would like to be able to swap between different key mapping profiles. I would also be satisfied with Key mapping having a target app similar to how shortcut mappings can have a target app.

@tmac213
Copy link

tmac213 commented Aug 24, 2024

snooping around a little it looks like the functionality already somewhat exists.

C:\Users\[user]\AppData\Local\Microsoft\PowerToys\Keyboard Manager\settings.json has a list of configurations and an active configuration:

{ "properties": { "activeConfiguration": { "value": "default" }, "keyboardConfigurations": { "value": [ "default" ] } }, "name": "Keyboard Manager", "version": "1" }

and C:\Users\[user]\AppData\Local\Microsoft\PowerToys\Keyboard Manager\default.json has what is currently the only possible active configuration. All that would need to be done is to have the user be able to save a configuration to the settings.json keyboardConfigurations array and select their activeConfiguration from that list of configurations. I would do it myself but i dont have any C++ experience. anyone here willing to take on the (easy) task?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Idea-Enhancement New feature or request on an existing product Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager
Projects
None yet
Development

No branches or pull requests