1

I want to change the shortcut for executing the current statement in MySql Workbench to Control-E, and I found this to get it done, but I can not get it to work.
This is the modification I have made in main_menu.xml

    <value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.execute_current_statementwin">
        <link type="object" key="owner" struct-name="app.MenuItem">com.mysql.wb.menu.query</link>
        <value type="string" key="caption">Execute Current Statement</value>
        <value type="string" key="name">query.execute_current_statement</value>
        <value type="string" key="command">builtin:query.execute_current_statement</value>
        <value type="string" key="itemType">action</value>
        <value type="string" key="shortcut">Modifier+E</value>
        <value type="string" key="platform">windows</value>
    </value>

But the shortcut for executing current statement is still Control-Enter.
What have I done wrong?
I found the main-menu.xml-file in the directory C:\Program Files\MySQL\MySQL Workbench 6.3 CE\data

Community
  • 1
  • 1

1 Answers1

0

It seems that MySQL Workbench does not allow multiple shortcuts for the same action. Make sure there is only one entry for com.mysql.wb.menu.query.execute_current_statementwin.

In the SQL Workbench installation folder, edit data/main_menu.xml. This example sets both execute and execute current statement (highlighted) to Ctrl-E to match SSMS.

<!-- be sure this id does not have another shortcut -->
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.exec">
  <link type="object" key="owner" struct-name="app.MenuItem">com.mysql.wb.menu.query</link>
  <value type="string" key="caption">Execute (All or Selection)</value>
  <value type="string" key="name">query.execute</value>
  <value type="string" key="command">builtin:query.execute</value>
  <value type="string" key="itemType">action</value>
  <value type="string" key="shortcut">Modifier+E</value>
</value>

<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.execute_current_statementwin">
  <link type="object" key="owner" struct-name="app.MenuItem">com.mysql.wb.menu.query</link>
  <value type="string" key="caption">Execute Current Statement</value>
  <value type="string" key="name">query.execute_current_statement</value>
  <value type="string" key="command">builtin:query.execute_current_statement</value>
  <value type="string" key="itemType">action</value>
  <value type="string" key="shortcut">Modifier+E</value>
  <value type="string" key="platform">windows</value>
</value>
Alien Technology
  • 1,760
  • 1
  • 20
  • 30