I really enjoy using vs code but there are some many shortcuts to remember and every new plugins come with a new set.
Of course, I can use the command palette in order to quickly execute a command, but I would like something even more faster such as assigning a shortcut to any of the keys for a device like a Novation Launchpad midi controller.
Stackoverflow is maybe not the best plase to ask this question but I didn't knew where to post it, so is there anyone who tried something like this? I have seen this video (https://www.youtube.com/watch?v=LOyNUGS4RC8) linking such a device with visual studio so perhaps someone created a software dedicated for vs code already.
Regards,
Johnny -
I've setup this with MIDI Loupe and midiStroke.
MIDI Loupe listens your device and logs channel/key/value you just hit on your midi controller - with this tool you inspect your device's output.
Then in midiStroke you map controls to shortcuts.
Note: I've found my midiStroke setup for M-Audio Axiom 49 keys don't require values (only key number) but controls (e.g. record start) do require it. Also for me letter keys didn't not work if uppercased (e.g. for garageband recording start I need simply R button hit and R should be r in this case)
Detailed tutorial here
Related
Title says it all, I'd like to implement a controls menu so the player can rebind controls, which changes the positive input key of a button in the Input Manager. But I can't find anything about it online.
How would I go about changing the positive key for a button while ingame?
Unfortunately, I believe you can't set Input Manager values via code at all. That's probably why you didn't find anything about it.
You've got two alternatives:
Use the "Input System" aka. the new input system that is available as a package. It is not as easy to use as the legacy input system, but you should check it out. It's also open source.
Use an asset store package. I've tested Rewired in the past and found it extremely powerful, especially compared to the legacy input system.
Personally, I'd first go with option 1 and see if you are happy with it. It's an official package and not 3rd party. Option 2 is still there, if you have issues with option 1, but it'll probably cost you money.
Preface (Imaginary. So someone does not ask 'What are you trying to do?):
I have a Win32 C++ application.
This application wants to know when the user wants to open the start menu via Ctrl+Esc
Of course, Ctrl+Esc is fired from the operating system so the application never see's it.
I have looked at Windows Virtual Keys.
I see that there are plenty of OEM specific VK's
(0x92-0x96,0xE0,0xE9-0xF5,..)
So my thought was:
Keyboard Filter Driver.
When my application has the focus it tells the Keyboard Filter Driver.
When my driver sees the Ctrl is down and an Esc down occurs (And my application has focus):
-- Swallow the Esc and replace it with a scan code that will produce say a VK_0x92 (OEM Specific).
Since I have swallowed the Esc the operating system will never see Ctr+Esc
My application will then see the VK_0x92 and know the user wants to open the start menu and perform some action.
My question is how do I 'muck' the input within my driver (KEYBOARD_INPUT_DATA) in order for a say
VK_0x92 to appear within my application?
Thanks in advance for any pointers.
It is all about the Keyboard Layout.
What I needed to do was not supported by Microsoft Keyboard Layout Creator (MKLC).
See: Keyboard Layout Samples.
I found the samples to be very old and hard to read through. Clearly the US and German keyboard samples are not the most recent.
I wrote a program to create Visual Studio projects for keyboard layouts by pointing to a specific layout (I.e, KBDUS.dll for example). I generate the source code, .vxcproj, ... I then make my modifications and build it.
Installing the layout is another can of worms entirely. I have asked in several places for Microsoft to release the source code for the CustomAction Dll that is contained within the MKLC generated .MSI to no avail.
In my extension, I would like to check in a certain function, if the control (or command) key is currently pressed. How is that possible? I couldn't find any field that exposes this information.
If you read the below article
https://code.visualstudio.com/docs/extensionAPI/patterns-and-principles
It says
Visual Studio Code has a very rich extensibility model and there are many ways to extend the tool. However, we do not provide direct access to the underlying UI DOM to extension writers. With VS Code, we’re continually trying to optimize use of the underlying web technologies to deliver an always available, highly responsive editor and we will continue to tune our use of the DOM as these technologies and our product evolve. To maintain performance and compatibility, we run extensions in their own host process and prevent direct access to the DOM. VS Code also includes a built-in set of UI components for common scenarios such as IntelliSense, so that these experiences are consistent across programming languages and extensions and extension developers do not need to build their own.
We realize that this approach may initially feel restrictive to extension developers. We’re always looking for ways to improve our extensibility model and expand the capabilities available to extensions. We look forward to hearing your feedback and ideas.
This means your extension code doesn't run the in editor window context at all. And you can't hack into the webview as the extension api doesn't provide it. So you need to open a Feature request with VScode team and ask them to expose either the last keyboard event or atleast the status of Shift, Ctrl and alt keys. Currently they just discard it and throw it away (if no editor is open) else they send it to the monaco editor before checking for any shortcut combination
This does not directly answer your question but maybe helps solving your problem:
Your extension could contribute two different commands: For example first command myextension.runTarget (noDebug=true) and myextension.debugTarget (noDebug=false). In addition your extension can contribute keybindings that bind those two commands to different hotkeys, for instance CTRL + F5 and only F5.
Looks like vscode itself does it the same way (screenshot of keybindings view):
This question might be of use. With this approach you could track a key down event and then if the key code is equal to command (91 or 93 on Safari/Chrome, 224 on Firefox) or control. From there, you could put in your functionality if this returns as true, or however you want to structure it
I have the mobile javaMe application that has been working on Nokia Phones. However, now I'm porting it to Samsung 5611, and I've faced with such a problem: no command is assigned on the central soft button, all of them are contained in the right-button menu. When the same midlet was launched on Nokia 3110c, one command was placed on central button, other ones (if >=2) were grouped into the options menu.
I tried Item.setDefaultCommand (no effect) and Display.getInstance().setThirdSoftButton(true) (such method not supported in SDK 3.4). Also I tried to change the type of one command to Ok or Screen, and change the priority, everything is without success.
Thanks in advance. Any idea will be helpful.
Sadly there's no way for the developer to decide exactly on which softbuttons the commands belong. It is the individual device that decides. Some devices has two softbuttons, and some has three.
You can fiddle a bit with priorities, but you still can't force commands to specific softbuttons.
That's high-level GUI (Form) for you.
If you want to have control of such things, you need to go with low-level GUI (Canvas / GameCanvas). Nowadays there are several APIs you can use to create Form-like low-level GUI. Check out LWUIT for example, which I imagine makes it easy for you to port your high-level code into low-level.
But even when using low-level coding, you have to be aware of different devices having different keycodes for the softbuttons.
My wife complains that I have too many icons on the Windows XP-Pro desktop.
I like to be able to quickly drop a file onto the icon for application I want to have open it. And I like to follow a link to open often-used deeply nested folders rather than navigate there. Thus, I have over 100 icons on the desktop.
(We share the same user account because we switch back and forth so often and because we both need to access the same e-mail, so separate accounts isn't the answer.)
I'd like to write a program which would have similar functionality to the Windows desktop. Then I could open that window to do the drag and drop work, but, when minimized, would leave the desktop display sparsely populated for my wife. As an added bonus, I could implement better organization of the icons than the desktop allows.
This is similar to what an Explorer window does, with the key exception that the desktop allows you to do some arrangement of icons. (For instance, program icons on the left (with the most used ones near the top), folders at the top, data files on the right.)
How do I go about getting an icon to display in a Windows Form (or on an appropriate control on the form)? (For instance, if I drop in a link to Notepad or a link to a file folder.)
How do I take the same action that the desktop does if the icon is double clicked? (For instance, if a link to a folder is double clicked.)
How do I take the same action that the desktop does if the icon has something dragged onto it? (For instance, a text file is dragged onto the Notepad icon.)
I'm using Visual Studio and C#.NET for programming.
I know how to do basic drag and drop.
I do not know:
A. what controls to use on the form to display the icons
B. how to find the icon
C. what commands are built by the desktop under various situations (so I can emulate the functionality)
I apologize that this is a multi-part question, but it was hard to break apart without explaining the whole story again.
This is a big question, but I'll give you some quick thoughts to get things moving in the right direction. WinForms exposes the functionality needed to make this happen, it's just a matter of wiring everything up the way you want it.
The key piece that you will want to look into is Drag/Drop, which is very well supported by WinForms. If you implement your icons as ImageBoxes you can set the AllowDrop property on the program icons and then handle the DragDrop event and have it call an overload of System.Diagnostics.Process() to start the application with the dropped filename as an argument.
As far as finding icons, most programs have their icon included as a resource in their .EXE file or in a related .DLL.
Regarding question C, the underlying question is what behaviors of the desktop would you like to have in your program? Explorer.exe is a massive application that does far more than what you need or what you will need or want to implement. Once you decide what functionality you want, play around with the IntelliSense list of events for the form and imagebox controls. You'll find that a lot of behavior is given to you for free in the Windows common controls, and additional behavior is fairly easy to add by handling the appropriate events.
Why dont you just use a Virtual Desktop??
Try http://virtuawin.sourceforge.net/
You will skip a lot of coding.
Right from their page:
"VirtuaWin is a virtual desktop manager for the Windows operating system (Win9x/ME/NT/Win2K/XP/Win2003/Vista). A virtual desktop manager lets you organize applications over several virtual desktops (also called 'workspaces'). Virtual desktops are very common in Unix/Linux, and once you get accustomed to using them, they become an essential part of a productive workflow."