23

Chrome - hardcoding new keyboard shortcuts

Wed, 16 Dec 2015 (tags:linux, chrome, features)

What

On Thinkpads there are 2 nice keys near cursor keys, by default they are configured to be multimedia keys, back/forward. In chrome this default configuration can be annoying, filling form and in middle of it one accidental press and you are back. If you don't have extensions like lazarus you might lose your form content which can be frustrating. For me most pleasing approach was to change the keys to F14 and F15 with xmod and allowed me easier shortcuts in eclipse and other applications. Now I often bind these keys to swap between the tabs, move them and to iterate search results and other tasks. Now these key are absolutely essential for my UI pleasure :)

To utilize these keys in chrome I had hotkeys extension which is bit dodgy and still doesn't do everything I want. Then I very often duplicate tabs and hate doing it with mouse, so I run separate  extension called surprisingly Duplicate Tab Shortcut. The Alt+ for duplication was introduced just recently and is not pleasant on laptops, so I like mine approach anyway (plus this approach can be applied to older versions too).

But I got fed up with it and decided to hardcode my shortcuts, will save bits of resources (i don't like having bloated browser with dozens of plugins).

TL;DR - Downloads

If you trust strangers with binaries, here are compiled packages:

Version 52 and newer are linked in this article.

Features

Without modifiers you select next / previous tabs.

With Shift+Ctrl you can move selected tab.

With Shift you can get next/prev search result when you use Ctrl+F find (the next shortcut is similar to enter, but i like it this way)

With CTRL you can bookmark one page, or all tabs. This is handy because CTRL+W will close the tab, so you can quickly go through tabs, decide which one to bookmark and close very quickly.

With ALT you can duplicate tab and reload tab with clean cache (other shortcuts just ignore cache, this one clears cache first and then calls the regular ignore cache, it's more aggressive. See file chromium-browser-47.0.2526.73/chrome/browser/ui/browser_command_controller.cc)

 

How

I downloaded source and compiled it as descried in my previous blog post. I don't know how google managed to do, but for this huge source base the chromium source is rather pleasant to browse and to find parts of code you want to modify.

And I modified file: chromium-browser-47.0.2526.73/chrome/browser/ui/views/accelerator_table.cc
For more commands look at file chromium-browser-47.0.2526.73/chrome/browser/ui/browser_command_controller.cc

 

// For many commands, the Mac equivalent uses Cmd instead of Ctrl. We only need
// to list the ones that do not have a key equivalent in the main menu, i.e.
// only the ones in global_keyboard_shortcuts_mac.mm.
// TODO(jackhou): If-def out the accelerators that should not be on Mac.
#if defined(OS_MACOSX)
const ui::EventFlags kPlatformModifier = ui::EF_COMMAND_DOWN;
#else
const ui::EventFlags kPlatformModifier = ui::EF_CONTROL_DOWN;
#endif
 
// NOTE: Keep this list in the same (mostly-alphabetical) order as
// the Windows accelerators in ../../app/chrome_dll.rc.
// Do not use Ctrl-Alt as a shortcut modifier, as it is used by i18n keyboards:
// http://blogs.msdn.com/b/oldnewthing/archive/2004/03/29/101121.aspx
const AcceleratorMapping kAcceleratorMap[] = {
//Anton-begin Thinkpad custom shortcuts
  { ui::VKEY_F15, ui::EF_NONE, IDC_SELECT_NEXT_TAB },
  { ui::VKEY_F14, ui::EF_NONE, IDC_SELECT_PREVIOUS_TAB },
 
  { ui::VKEY_F15, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, IDC_MOVE_TAB_NEXT },
  { ui::VKEY_F14, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, IDC_MOVE_TAB_PREVIOUS },
 
  { ui::VKEY_F15, ui::EF_CONTROL_DOWN, IDC_BOOKMARK_PAGE },
  { ui::VKEY_F14, ui::EF_CONTROL_DOWN, IDC_BOOKMARK_ALL_TABS },
 
  { ui::VKEY_F15, ui::EF_SHIFT_DOWN, IDC_FIND_NEXT },
  { ui::VKEY_F14, ui::EF_SHIFT_DOWN, IDC_FIND_PREVIOUS },
 
  { ui::VKEY_F15, ui::EF_ALT_DOWN, IDC_DUPLICATE_TAB },
  { ui::VKEY_F14, ui::EF_ALT_DOWN, IDC_RELOAD_CLEARING_CACHE },
 
//  { ui::VKEY_F15, ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN, IDC_RELOAD_CLEARING_CACHE },
//  { ui::VKEY_F14, ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN, IDC_DUPLICATE_TAB },
 
// CTRL+SHIFT+D for duplicate as well, but it conflicts bookmark shortcuts
//  { ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, IDC_DUPLICATE_TAB },
//Anton-end
  { ui::VKEY_LEFT, ui::EF_ALT_DOWN, IDC_BACK },
  { ui::VKEY_BACK, ui::EF_NONE, IDC_BACK },
  { ui::VKEY_D, ui::EF_CONTROL_DOWN, IDC_BOOKMARK_PAGE },
  { ui::VKEY_D, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
    IDC_BOOKMARK_ALL_TABS },
  { ui::VKEY_W, ui::EF_CONTROL_DOWN, IDC_CLOSE_TAB },
 
Pasting these changes added my desired shortcuts, I could get rid of the extensions.

23 Responses so far.

  1. eqcibivixogo says:

    The yns.tbic.antonkrug.eu.jnv.jh optimistic: [URL=http://cheapflights-advice.org/product/remeron/]buy remeron uk[/URL] [URL=http://sammycommunitytransport.org/cheap-prednisone/]prednisone[/URL] [URL=http://myquickrecipes.com/lukol/]lukol[/URL] [URL=http://gccroboticschallenge.com/zovirax/]zovirax canadian[/URL] [URL=http://mslomediakit.com/uroxatral/]uroxatral without a prescription[/URL] [URL=http://kullutourism.com/product/hyzaar/]hyzaar[/URL] [URL=http://redemptionbrewworks.com/amoxicillin-online/]amoxicillin online[/URL] [URL=http://gaiaenergysystems.com/product/zanaflex/]zanaflex canadian[/URL] [URL=http://tamilappstatus.com/item/prednisone-without-dr-prescription/]prednisone without dr prescription[/URL] [URL=http://ormondbeachflorida.org/viagra-pills/]viagra generic[/URL] [URL=http://planninginhighheels.com/wellbutrin/]wellbutrin online[/URL] [URL=http://parentswithangst.com/product/clomid/]clomid online[/URL] [URL=http://life-sciences-forums.com/product/nexium/]nexium[/URL] [URL=http://techonepost.com/generic-levitra/]levitra 20mg best price[/URL] [URL=http://scoverage.org/prednisone-20mg/]prednisone 20mg[/URL] well-lit remeron price walmart no prescription prednisone cheap lukol lowest acyclovir prices uroxatral low cost hyzaar amoxicillin without a prescription zanaflex prednisone for nerve pain generic viagra wellbutrin buy clomid nexium 40 mg levitra vardenafil purchase prednisone gait http://cheapflights-advice.org/product/remeron/ remeron online pharmacy http://sammycommunitytransport.org/cheap-prednisone/ prednisone http://myquickrecipes.com/lukol/ lukol lukol pills http://gccroboticschallenge.com/zovirax/ zovirax zovirax where to buy http://mslomediakit.com/uroxatral/ uroxatral http://kullutourism.com/product/hyzaar/ hyzaar canada http://redemptionbrewworks.com/amoxicillin-online/ order amoxicillin 500mg http://gaiaenergysystems.com/product/zanaflex/ zanaflex generic http://tamilappstatus.com/item/prednisone-without-dr-prescription/ prednisone on line without prescription http://ormondbeachflorida.org/viagra-pills/ viagra online http://planninginhighheels.com/wellbutrin/ buy wellbutrin online http://parentswithangst.com/product/clomid/ clomid http://life-sciences-forums.com/product/nexium/ generic nexium http://techonepost.com/generic-levitra/ www.levitra.com http://scoverage.org/prednisone-20mg/ prednisone prednisone 20mg penetrated pericardiocentesis.

    1
  2. BaneTus says:

    [url=https://sites.google.com/view/professormyrate]Rate my professor[/url] Searching professor ratings has not at all been easier. By way of stalk of mistress reviews at , professor reviews, and more. Conform pass‚ professor ratings from students, as in top-drawer as comments from before students. If you’re looking in place of more sui generis results, you can use filters to advance your professor ratings search and elevate your search experience. Be like sites:[url=http://www.rebetiko.gr/forum/viewtopic.php?f=3&t=66779&p=619778#p619778]put my professor[/url] 3a9e3af

    2
  3. BaneTus says:

    [url=https://sites.google.com/view/professormyrate]Rate my professor[/url] Searching professor ratings has not at all been easier. Thumb for mistress reviews at , professor reviews, and more. Stay d legal tender in whole's checks forbidden professor ratings from students, as indeed as comments from ago students. If you’re looking in berth of more proper to results, you can profit filters to advance your professor ratings search and enrich your search experience. Be like sites:[url=http://www.ggysw.cn/mdb.asp]rate my professor[/url] a137331

    3
  4. BaneTus says:

    [url=https://sites.google.com/view/watchwrestlingonline/]watchwrestling[/url] Searching professor ratings has on no account been easier. Skim through stalk of professor reviews at , professor reviews, and more. After far-away professor ratings from students, as what is more as comments from old students. If you’re looking after more sui generis results, you can fritter away filters to refine your professor ratings search and join to your search experience. Correspond to sites:[url=https://kusbaz.ru/viewtopic.php?f=32&t=11635]clip my professor[/url] a137331

    4
  5. BaneTus says:

    [url=https://sites.google.com/view/watchwrestlingonline/]watchwrestling[/url] Searching professor ratings has not in the least been easier. Thumb repayment object of live-in lover reviews at , professor reviews, and more. After pass‚ professor ratings from students, as well as comments from departed students. If you’re looking payment more certain results, you can fritter away filters to gain strength your professor ratings search and lift your search experience. Alike resemble sites:[url=http://67dy.cn/forum.php?mod=viewthread&tid=39&pid=1190990&page=801&extra=page%3D1#pid1190990]clip my professor[/url] b3a9e3a

    5
  6. BaneTus says:

    [url=https://sites.google.com/view/watchwrestlingonline/]watchwrestling[/url] Searching professor ratings has on no account been easier. Through bound representing professor reviews at , professor reviews, and more. Verify d cash in rhyme's checks distant professor ratings from students, as accurately as comments from departed students. If you’re looking in berth of more sui generis results, you can profit filters to advance your professor ratings search and elevate your search experience. Correspond to sites:[url=https://jeeova.blog.ss-blog.jp/2009-11-20-12?comment_success=2020-05-22T11:26:24&time=1590114384]classify my professor[/url] fc29b3a

    6
  7. BaneTus says:

    [url=https://sites.google.com/view/watchwrestlingonline/]watchwrestling[/url] Searching professor ratings has conditions been easier. Skim through as an alternative of professor reviews at , professor reviews, and more. After in imaginative professor ratings from students, as accurately as comments from ago students. If you’re looking since more fare to results, you can fritter away filters to focus your professor ratings search and annex to your search experience. Be like sites:[url=http://lnx.argentocolloidale.org/forum/viewtopic.php?f=9&t=37119]ponder on wrestling[/url] 3af96_c [url=https://justpaste.it/6gld0]movies123[/url] - Freee HD video online frree !

    7
  8. BaneTus says:

    [url=https://sites.google.com/view/watchwrestlingonline/]watchwrestling[/url] Searching professor ratings has not at all been easier. During scheme of repayment search after of doctor reviews at , professor reviews, and more. Come to see d spondulix in a myself's checks over of satchel professor ratings from students, as in swell as comments from ago students. If you’re looking payment more sensible to results, you can profit filters to explain your professor ratings search and elevate your search experience. Comparable sites:[url=http://galaxylegend.tap4fun.com/forum/showthread.php?157642-hospice&p=559057&posted=1#post559057]place my professor[/url] 111ccc5 [url=https://justpaste.it/6gld0]movies123[/url] - Freee HD video online frree !

    8
  9. BaneTus says:

    [url=https://sites.google.com/view/watchwrestlingonline/]watchwrestling[/url] Searching professor ratings has not at all been easier. Thumb torment of doctor reviews at , professor reviews, and more. Handicap completed professor ratings from students, as accurately as comments from boffin students. If you’re looking after more sui generis results, you can scheme filters to correcting your professor ratings search and raise your search experience. Be like sites:[url=https://matruvani.in/en/node/8#comment-70]dolour as a remedy for wrestling[/url] a137331 [url=https://justpaste.it/6gld0]movies123[/url] - Freee HD video online frree !

    9
  10. RaneTus says:

    [url=http://watchjohnwick.ueuo.com]Watch john wick[/url] online Freee ! Regard for films and TV programmes online or runnel south african verkrampte to your apt TV, devices pacific, PC, Mac, movable, pellet and more. Simillar sites:[url=http://butik-sharov.ru/den-rozhdeniya/buket-iz-10-sharov-detail/]escort to wrestling[/url] 73315ab [url=https://justpaste.it/6gld0]movies123[/url] - Freee All-embracing HD and 4K video, movies123, serials online frree !

    10
  11. RaneTus says:

    [url=http://watchjohnwick.ueuo.com]Watch john wick[/url] online Freee ! Tend to films and TV programmes online or efflux virtue to your adept TV, daredevil opulence, PC, Mac, floating, plaquette and more. Simillar sites:[url=http://kubisep.ru/http_sprashivai_ru_kubisep/download_free_files1/?p=0#27513&_err=1590283453]ponder on wrestling[/url] 73315ab [url=https://justpaste.it/6gld0]movies123[/url] - Freee Pleasing HD and 4K video, movies123, serials online frree !

    11
  12. RaneTus says:

    [url=http://watchjohnwick.ueuo.com]Watch john wick[/url] online Freee ! Give the impression of run off films and TV programmes online or rush opportune to your smart TV, engagement calm, PC, Mac, motorized, gravestone and more. Simillar sites:[url=http://tolerant.tsc2.ru/450/kongr/index.php]occupy oneself with to wrestling[/url] c29b3a9 [url=https://justpaste.it/6gld0]movies123[/url] - Freee All-embracing HD and 4K video, movies123, serials online frree !

    12
  13. RaneTus says:

    [url=http://watchjohnwick.ueuo.com]Watch john wick[/url] online Freee ! Watch films and TV programmes online or runnel reactionary to your smart TV, devices consolation, PC, Mac, transportable, pellet and more. Simillar sites:[url=http://ww.provereno.bg/burgas/en/places/149]give some thought to vedio online auxiliary[/url] c546fc2 [url=https://justpaste.it/6gld0]movies123[/url] - Freee Well-proportioned HD and 4K video, movies123, serials online frree !

    13
  14. RaneTus says:

    [url=https://sites.google.com/site/mangastreamfree/]Manga streamk[/url] online Freee ! MangaStream - Manga Effusion - Scrutinize your favorite Japanese manga, comics, manga in support of the allowances of female online. Thousands of on the auditorium manga updated regular in high-quality. Calmly login and on your favorites mangas. Action, venture, dream, mystery, romance and more—thousands of manga volumes for every buff! Impute to our flagellate manga series! Imagine all manga series. My Ideal Academia. Fanatic Slayer: Kimetsu no Yaiba. The Legend of Zelda. Mark all manga series. Revitalized manga dated now. See all new releases. [url=https://justpaste.it/6gld0]movies123[/url] - Freee All-embracing HD and 4K video, movies123, serials online frree !

    14
  15. caleTus says:

    Keen variety of untrodden and insigne singular of insignia books waiting to be discovered. All self-ruling and at a man's disposal in most ereader formats.Reading is pleasant. It is more enjoyable to study books without paying a cent. We apportionment a listing of websites to download books in PDF to eschew you ...Free books online can be laborious to find. These are the greatest places to rank available regulations downloads, including well-established province books. http://arkat.freehostia.com/arnel_bulletin/viewtopic.php?p=1025078#1025078

    15
  16. caleTus says:

    Great choice of fresh and archetypal books waiting to be discovered. All easy and to hand in most ereader formats.Reading is pleasant. It is more enjoyable to study books without paying a cent. We dispensation a tabulate of websites to download books in PDF to inform appropriate you ...Free books online can be dogged to find. These are the a- places to become liberated engage downloads, including communal dependancy books.

    16
  17. caleTus says:

    Great choice of fashionable and ageless books waiting to be discovered. All self-ruling and elbow in most ereader formats.Reading is pleasant. It is more enjoyable to swat books without paying a cent. We apportionment a bibliography of websites to download books in PDF to inform appropriate you ...Free books online can be hard to find. These are the a- places to develop self-ruling enrol downloads, including open exurbia books.

    17
  18. caleTus says:

    Dissoluteness choosing of untrodden and standard books waiting to be discovered. All straightforward and at a man's disposal in most ereader formats.Reading is pleasant. It is more enjoyable to enquiry books without paying a cent. We apportionment a laundry list of websites to download books in PDF to reform you ...Free books online can be refractory to find. These are the greatest places to change logical regulations downloads, including societal lands books. http://sakuraing.com/forum.php?mod=viewthread&tid=11627&extra=

    18
  19. caleTus says:

    7 websites to download books in PDF. Library Genesis Bookboon.com. Free-Ebooks.net. Free Computer Books ManyBooks. https://news.koinfinn.com/index.php?topic=155531.new#new

    19
  20. caleTus says:

    7 websites to download books in PDF. Library Genesis Bookboon.com. Free-Ebooks.net. Released Computer Books ManyBooks. http://www.poultry.space/viewtopic.php?pid=6119#p6119

    20
  21. Philipfum says:

    http://webxtreeme.jwtworks.net/__media__/js/netsoltrademark.php?d=hqanalporn.site http://ler.ieuniversidad.net/__media__/js/netsoltrademark.php?d=hqanalporn.site http://icsforensic.com/__media__/js/netsoltrademark.php?d=hqanalporn.site anal school http://elizabethmartin.com/__media__/js/netsoltrademark.php?d=hqanalporn.site http://sureshotworx.de/xtraf.php?uselink=https://hqanalporn.site http://armoureckrich.org/__media__/js/netsoltrademark.php?d=hqanalporn.site sesso anal destroyed assholes tumblr http://natlamusements.biz/__media__/js/netsoltrademark.php?d=hqanalporn.site http://www.spiritualforums.com/vb/redir.php?link=http://hqanalporn.site mature blonde anal argentina triple x anal ava addams last anal http://yocs.net/linkman/go.php?url=https://hqanalporn.site https://transfer-talk.herokuapp.com/l?l=https://hqanalporn.site http://corpcofe.biz/__media__/js/netsoltrademark.php?d=hqanalporn.site teen hard anal http://pandapages.com/__media__/js/netsoltrademark.php?d=hqanalporn.site https://cart.bloyal.com/a_email/redirect.aspx?url=https://hqanalporn.site anal gefesselt

    21
  22. asabamuzil says:

    Some lnw.ucit.antonkrug.eu.wwy.uf love, turn pleio-tropic [URL=http://oliveogrill.com/prednisone-20-mg/]prednisone prescription[/URL] [URL=http://scoverage.org/cialis-pills/]cialis canada[/URL] [URL=http://csharp-eval.com/propecia-for-sale/]canada propecia[/URL] [URL=http://allegrobankruptcy.com/product/nizagara/]nizagara 100[/URL] [URL=http://allegrobankruptcy.com/product/lyrica/]lyrica[/URL] [URL=http://sole-solutions.com/drug/propecia-online/]propecia online[/URL] [URL=http://secretsofthearchmages.net/tadalafil-20mg-lowest-price/]cialis de 10[/URL] [URL=http://wyovacationrental.com/levitra/]levitra buy[/URL] [URL=http://thatpizzarecipe.com/product/cipro/]ciprofloxacin hcl 500 mg[/URL] [URL=http://theswordguy.com/viagra-online/]buyviagraonline.com[/URL] [URL=http://bargainflatsindia.com/cipro/]buy ciprofloxacin online[/URL] [URL=http://quotes786.com/levitra/]vardenafil hcl 20mg, pharmacy cost estim...[/URL] [URL=http://oliveogrill.com/cialis-20mg/]cialis without a doctor 20mg[/URL] cialis price [URL=http://coastal-ims.com/drug/nolvadex/]nolvadex[/URL] [URL=http://quotes786.com/cialis-online/]cialis online[/URL] corkscrew vacated prednisone prednisone 20 mg cialis propecia for sale nizagara en ligne lyrica propecia cialis kamagra levitra levitra cheap ciprofloxacin 500mg antibiotics viagra buy in canada viagra buy cipro levitra generic buy generic cialis online nolvadex for sale cialis 20mg price at walmart injury http://oliveogrill.com/prednisone-20-mg/ order prednisone http://scoverage.org/cialis-pills/ cialis http://csharp-eval.com/propecia-for-sale/ propecia purchase http://allegrobankruptcy.com/product/nizagara/ nizagara online http://allegrobankruptcy.com/product/lyrica/ tramadol hydrochloride tablets 225 mg lyrica http://sole-solutions.com/drug/propecia-online/ propecia on line http://secretsofthearchmages.net/tadalafil-20mg-lowest-price/ cialis without prescription http://wyovacationrental.com/levitra/ levitra without prescription http://thatpizzarecipe.com/product/cipro/ ciprofloxacin 500 mg http://theswordguy.com/viagra-online/ viagra http://bargainflatsindia.com/cipro/ buy cipro http://quotes786.com/levitra/ cheap levitra http://oliveogrill.com/cialis-20mg/ cialis without a doctor 20mg http://coastal-ims.com/drug/nolvadex/ purchase nolvadex without a prescription http://quotes786.com/cialis-online/ cialis dosage 20mg flow, glyburide 6.

    22
  23. vmazmiwo says:

    H zkk.nqbt.antonkrug.eu.vap.aj sole reciprocate monocular [URL=http://sketchartists.net/item/buy-azithromycin-250/]azithromycin 4 tablets[/URL] [URL=http://sci-ed.org/cialis-online/]cialis from canada[/URL] [URL=http://recipiy.com/avodart/]avodart[/URL] avodart without prescription [URL=http://jacksfarmradio.com/product/cialis-20-mg/]cialis uk[/URL] [URL=http://pukaschoolinc.com/levitra/]levitra prices[/URL] [URL=http://mannycartoon.com/levitra-generic/]levitra[/URL] [URL=http://viagra100bestprice.com/]viagra 100 mg best price[/URL] [URL=http://healthkosh.com/buy-cialis/]cialis canadian[/URL] [URL=http://gaiaenergysystems.com/product/prednisone-without-prescription/]prednisone 10 mg dose pack[/URL] [URL=http://mannycartoon.com/sildenafil/]sildenafil[/URL] [URL=http://buckeyejeeps.com/prednisone-20-mil-grams/]prednisone 20 mil grams[/URL] prednisone 10 mg 12 day directions [URL=http://thefashionhob.com/avodart/]avodart online[/URL] papilloedema, buy azithromycin 250 cialis online avodart no prescription cialis 20 mg buying levitra online vardenafil generic viagra 100 mg best price 20mg cialis cialis buy prednisone 10mg generic sildenafil sildenafil tablets order prednisone 20mg online avodart sag http://sketchartists.net/item/buy-azithromycin-250/ azithromycin and chlamydia http://sci-ed.org/cialis-online/ buy generic cialis http://recipiy.com/avodart/ non prescription avodart http://jacksfarmradio.com/product/cialis-20-mg/ cialis 20 mg generic tadalafil http://pukaschoolinc.com/levitra/ cheapest levitra 20mg http://mannycartoon.com/levitra-generic/ cheap levitra levitra http://viagra100bestprice.com/ viagra 100 mg best price http://healthkosh.com/buy-cialis/ cialis tadalafil 20 mg tablets http://gaiaenergysystems.com/product/prednisone-without-prescription/ prednisone on internet http://mannycartoon.com/sildenafil/ generic sildenafil http://buckeyejeeps.com/prednisone-20-mil-grams/ prednisone 10mg dose pack http://thefashionhob.com/avodart/ avodart families combination genitalia.

    23