How do I create a hotkey to change default sound device with Logitech keyboard? - audio

It's really annoying to have to manually change default sound device, especially when I'm playing a game.
How can I program a hotkey to do this?

Step 1: Download nircmd
http://www.nirsoft.net/utils/nircmd.html
The download link is at the bottom of this page. This will enable you to manipulate your default sound device via command line
Step 2: Unzip and move executables to your system directory
This will ensure you can just use "nircmd" in future steps instead of worrying about directory context. You can skip moving the directory if you'd like, you'll just need specify an absolute path for your shortcut in step 4
Step 3: Give your sound devices meaningful names
Right click the sound devices icon in your system tray, select playback devices
Right click sound device, select Properties
Change name to something unique (Speakers/Headphones is fine as long as nothing else is named that!)
Do this for each device you need to toggle between
Step 4: Bind your G Keys
Open the Logitech app and select the tab at the bottom that looks
like a G key
Select the GKey you want to create a binding for (there should be a down carrot when you hover over it)
Select Assign New Command
Select Shortcut
Name it something you will recognize, like "Use Speakers"
Enter the following for the command (secondtextbox), changing DeviceName to the name of the device from step 3:
nircmd setdefaultsounddevice "DeviceName" 1
Repeat these steps for each device you want to toggle between
That's it! Your keys are ready to use!

Related

Prevent mouse from waking computer from sleep mode

Mouse seems to wake my computer from sleeping at the smallest touch, this is totally useless, but found no way to turn it off.
I did disable the 'Allow device to wake computer..' under Device Manager > Mouse settings.
Windows 10 and mouse is a Logitech M220.
I suggest you the following method, check if it works correctly.
1: Open Command Prompt with Run as administrator
2: type powercfg \DEVICEDISABLEWAKE "devicename" and press Enter
3: Restart the computer
Note: Use your device name you want to disable within quotes instead of devicename, in my example my device name is HID-compliant mouse, you can find your device name from Device Properties > Hardware > Devices > Name

get hardware scancode corresponding to XKeyPressedEvent

I am working on an open source project to add something in that i need. It uses an XInput system to get input from the keyboard and i cannot change that. However, for keypresses, i need to get the hardware scancodes, like those listed here. Is there a way to go from an XKeyPressedEvent to these KEY_* scan codes from input-event-codes.h, to know what key was pressed in a layout independent way?

Black Screen with cursor before log in

I have tried all the possible solutions to solve it given in the internet. But my problem does not solved.
So I want to reset my pc. If so is my pc get back to normal state. Previously I have resetted my pc for another problem. Is my resetting option works again. My friends said that reset options works only once...
Can anybody suggest me what to do??
The issue here seems to be that Windows thinks you have a new monitor that does not exist.
The most common solution that seems to have worked for many people (did not actually work for me, but worth a try): Wait long enough so the mouse cursor to appear when you move the mouse. (blank screen with a white mouse cursor) Then press the Ctrl and enter your login password. Wait until login competed then press Win+P keys, down arrow keys twice, and enter to extend display. (this spans your monitors onto one display)
The solution that worked for me was to unplug all monitors, reboot (hard reset, holding down power button), then plug in just one monitor. (may need to reboot again)
I solved the issue by pressing
Press Ctrl+alt+Esc.
Task Manager Window Appears,Then Click File
Option above,then Select Run New Task from the options that are
listed.
3.Create New Task Window appears and type "explorer" and press Ok. Screen Appears and Restart your laptop again .
You can try the following solution. It works perfectly. 1. Press Ctrl+alt+del 2. Select Task manager 3. Select File option above 4. Click Run new task 5. Type "explorer.exe" and press Enter You'll screen appears again!!

How can I change the default preview device in Android Studio?

When I'm creating a new project, the default preview device appears as Nexus 4. Is there a way to change it to some other device?
Recently I had the same issue.
It seems that you cannot use a device from the "virtual device" category. That way only the selected layout will be shown inside the chosen device.
In order to change the default device for all layouts you have to choose from some of the other categories (the ones inside the red rectangle):
I have chosen "6.0 1440 x 2560" from "Phone" and all my other layouts changed to this device (before I was selecting "Nexus6_API_29_Android" which was my virtual device, and I had to change it on every layout manually)
Same issue was appearing for me, when I was selecting device for preview from 'Virtual Device'.
To select device which will be default for preview when opening activities choose from these in picture, which are marked in red rectangles.
Change the preview device>>for example: nexus5x or others.
File--Export Setting, then choose a dictionary to save it. For example, I save it on my desktop, next you will see a settings.jar on your desktop.
File-Import Setting, choose the settings.jar.
Android Studio will want to restart itself, click OK
My English is very poor. I'm so sorry.
Maybe it works well. I'm not sure. You can try it.
The top answer covers most cases.
But if you want to use a custom made device you can also click on the Generic Phones and Tablets option, and choose your device from there.
You just need to follow few steps to do this
Step One
Open Any layout file from
App >> res >> layout directory
Step Two
go to the above red marking option
Then you will find the available devices for change
N.B. I am using Android Studio 3.6.2
Go to Run -> Edit Configurations. "Under Deployment Target Options", de-select "Use same device for future launches."
To prevent the same device from being used on subsequent previews, when you create a new project and run it in the AVD, do not select "use the same device."

How can I create a button (or hotkey) that will automatically connect my bluetooth headset?

I have a bluetooth headset that I would like to be able to quickly switch between connection from my laptop(running windows 8) to my phone. I downloaded autohotkey to help me make a hotkey that would connect to my bluetooth headset, but I was only able to make a hotkey that would open the bluetooth control panel for my specific headset, which is not what I was trying to accomplish. What I am trying to accomplish is a hotkey that would immediately connect my headset when typed.
The code I used in autohotkey, to open the bluetooth control panel(by clicking Ctrl+Alt+B) is:
^!b:: run "C:\Program Files\WIDCOMM\Bluetooth Software\BTWUIExt.exe" /deviceAddr=445ef3aa5294
this code won't work for you as the numbers and letters on the end are a uniqe idendifier for my specific headset. You can find your unique id by opening bluetooth in the control panel and right clicking your headset, selecting properties, clicking the bluetooth tab (remove the dots and colons).
This worked to connect the first bluetooth device in the list (Windows 10)
#SingleInstance,force
;https://autohotkey.com/board/topic/83571-autohotkey-connect-to-bluetooth/
^F1::
Run, bthprops.cpl
Sleep, 2000
Send, {tab}{tab}{enter}{tab}{enter}
Sleep, 200
Send,!{Tab}
return
There is very little information to give exact solution. But from given information I can say:
You can automate GUI with AutoHotkey so that script will go to the
place where unique id is located. In fact, AutoHotkey allows any
GUI automation (conventional or non conventional GUI).
If the unique id is there as a text and you can copy it, then it
also can be automated by several ways. If unique id cant be coped
and is as image, then it is slightly complicated and you need to use some OCR
techniques. In that case you need to make screenshot of that region
and use some OCR script getting text out of it. Or with AutoHotkey pass image to OCR software and get text from it.
After you have text, you can manipulate it the way you like. Most powerfull solution
is Regular Expressions which are supported by AutoHotkey.
When unique id is ready to use, you can use it in Run
command this way:
^!b:: run "C:\Program Files\WIDCOMM\Bluetooth Software\BTWUIExt.exe" %MyUnicIDVariable%
Turns out that the code I have works on its own. If I just wait for about 10 seconds after typing out the hotkey, the headphones connect, and the control panel that opened automatically closes. Quite convenient actually as I didn't expect it to connect or to auto-close the window.
Thanks for the effort anyway!
Try to install [Broadcom Bluetooth 4.0 Driver for Windows 8.1 ] LINK=>> 1 !
At least works fine on my HP-EliteBook-8570p with stereo "BlueDio 99B" headset. After switching the headset ON the Windows connect the device automatically, and switch Audio-Stream into new-attached device. Optimal!
PS - Unfortunately it is still the Problem with Windows 8.1 + Skype( MIC-Problem) :( Windows 8 is the first OS, than not support Skype at all! ;)

Resources