Wednesday, April 1, 2015

Want to map your keyboard with the keyboard for your VM?

Recently I had to work in VMs for few of my projects and the biggest burden is the changes in keyboard. I am using a Mac and wanted to use Windows on a VM for a project. It is really irritating when you have to work in both environments interchangeably. You will definitely press cmd + c to copy in your windows VM and wonder why cmd + v won't work :O

I could find a simple solution for this with the help of autohotkey.
So this is how I map the Mac keyboard to Windows VM. ( and I am using VirtualBox)


Map the hostkey of the VirtualBox to right command key.


Start VirtualBox
Select VirtualBox > Preferences from the top menu



Input > Virtual Machine
Search for 'host key combination' and set the right command key for the key combination



Setup the VM to have changes


Download autohotkey to VM
Create a file in VM with extension .ahk ( ie: script.ahk )
Following is a sample content for the file with some of the most useful key mappings

#SingleInstance force
#r::Send ^r ;reload
#z::Send ^z ; undo
#y::Send ^y ; redo
#f::Send ^f ; find inside apps
#c::Send ^c ; copy
#x::Send ^x ; cut
#v::Send ^v ; paste
#t::Send ^t ; new tab, Firefox
#s::Send ^s ; save inside apps
LWin & Tab::AltTab ; the motherlode, alt-tab!
#b::Send ^b ; bold / bookmarks in Firefox
#i::Send ^i ; italic
#u::Send ^u ; underline
#a::Send ^a ; select all

Save the content and save the file.
Right click on file and do 'run as administrator' and you are ready to go... :)


Add the script to the Startup Programs


Add your file to Startup folder and you will have no issue with VM restarts...
Start > Program Files > Startup

Hope you will find your life with VMs much more easier with this.


3 comments:

  1. Sickbits
    Sickbits is a library of unlimited hacks for android, ios smartphones. Get unlimited amount of hacks and modes for mac & pc. EASEUS DATA RECOVERY WIZARD CRACK WITH PRODUCT KEY

    ReplyDelete
    Replies
    1. Big data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. big data projects for students But it’s not the amount of data that’s important.Project Center in Chennai

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Corporate TRaining Spring Framework the authors explore the idea of using Java in Big Data platforms.

      Spring Training in Chennai

      The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. It's very useful blog post with informative and insightful content and i had good experience with this information. We, at the CRS info solutions ,help candidates in acquiring certificates, master interview questions, and prepare brilliant resumes.Find top Salesforce admin interview questions in 2020.
    These Salesforce developer interview questions are highly helpful in 2020. You can read these Salesforce lightning interview questions and Salesforce integration interview questions which are prepared by industry experts.

    ReplyDelete