问题标签 [shortcut]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
216 浏览

python - 如何让我的程序通过键盘快捷键执行功能?

即使我的 application.exe 不是焦点窗口,我该怎么做?

例如,像Windows+D快捷方式...适用于任何地方...

我希望ALT+1执行一个功能,ALT+2执行另一个功能,依此类推...

0 投票
2 回答
28399 浏览

java - 在netbeans中停止执行程序的快捷方式

我正在使用 netbeans 编写 java 代码,我想知道是否有一个选项可以通过按下快捷方式来停止程序。我可以按F6来执行程序,但我必须使用鼠标停止程序,我觉得这有点烦人。

非常感谢阿尔弗雷德

0 投票
5 回答
50890 浏览

wpf - 将 WPF 快捷键绑定到 ViewModel 中的命令

我有一个使用 MVVM 模式的 WPF 应用程序。将按钮连接到 VM 非常简单,因为它们实现了 ICommand。我有一个类似的上下文菜单。下一步是为上下文菜单创建快捷键。我不知道如何让快捷键调用命令。这是一个例子:

现在我添加了这个:

尝试将快捷键连接到相同的绑定,但这不起作用。错误是:

错误 169 无法在“KeyBinding”类型的“Command”属性上设置“Binding”。只能在 DependencyObject 的 DependencyProperty 上设置“绑定”。

没有办法将此事件与命令挂钩吗?我想不通。

提前致谢!

账单

0 投票
2 回答
78 浏览

php - 如何从内存中的数组生成数组字符串(php)

我需要在我的代码中创建一个大数组,我在几个表中都有值(以便于管理)。我选择了它,现在我以我想要的方式在内存中拥有数组中的所有值。我的问题,我需要把这个数组写下来,到代码中。有没有办法把一个位于内存中的数组转换成一个字符串 "array('g'=>'h','b'=>'d'....)" 然后我可以回显只是复制粘贴到我的代码中?

0 投票
3 回答
9666 浏览

java - 在 Eclipse IDE 中展开折叠的代码

不是通过左侧的每个 (+) 符号并单击它们来展开折叠的代码片段,而是有一个快捷方式或菜单项(我找不到它,VS 有)来展开所有折叠的代码/注释一次?谢谢。

0 投票
2 回答
1855 浏览

visual-studio - Visual Studio“在浏览器中查看”特定页面的快捷方式?

我们正在使用Visual Studio 2008,想知道是否有办法为“在浏览器中查看”命令创建(键盘或工具栏)快捷方式,但使用来自特定(已加载)项目的特定页面。

我们总是从“Project-x”的“Somepage.aspx”开始测试/调试我们的应用程序。我想从这个特定的项目创建一个使用这个特定页面/文件的“在浏览器中查看”的快捷方式。因此,即使我目前正在处理另一个项目中的另一个文件(来自同一个解决方案),它仍然应该可以工作......

任何人都知道这是否可能,如果可以,如何实现?

谢谢!W。

0 投票
6 回答
7900 浏览

windows - Administrator's shortcut to batch file with double quoted parameters

Take an excruciatingly simple batch file:

Save that as test.bat. Now, make a shortcut to test.bat. The shortcut runs the batch file, which prints "hi" and then waits for a keypress as expected. Now, add some argument to the target of the shortcut. Now you have a shortcut to:

The shortcut runs the batch file as before.

Now, run the shortcut as administrator. (This is on Windows 7 by the way.) You can use either right-click -> Run as Administrator, or go to the shortcut's properties and check the box in the advanced section. Tell UAC that it's okay and once again the shortcut runs the batch file as expected.

Now, change the arguments in the target of the shortcut to add double quotes:

Now try the shortcut as administrator. It doesn't work this time! A command window pops up and and disappears too fast to see any error. I tried adding > test.log 2>&1 to the shortcut, but no log is created in this case.

Try running the same shortcut (with the double quotes) but not as Administrator. It runs the batch file fine. So, it seems the behavior is not because of the double quoted parameters, and it's not because it's run as Administrator. It's some weird combination of the two.

I also tried running the same command from an administrator's command window. This ran the batch file as expected without error. Running the shortcut from the command window spawned a new command window which flashed and went away. So apparently the issue is caused by a combination of administrator, the shortcut, and the double quotes.

I'm totally stumped, does anyone have any idea what's going on? I'd also like a workaround.

0 投票
1 回答
3211 浏览

wix - 在不同的片段中添加 WiX 文件的快捷方式

我正在使用 heat.exe 生成与此类似的片段:

这些片段存储在自动生成的 wxs 文件中。

然后我将它们添加到我的功能中(在主 WiX 文件中),如下所示:

这工作正常。

但是,我还想将 Bar.exe 的快捷方式添加到我的开始菜单中。理想情况下,我希望在我的主 wix 文件中执行此操作,而 Bar.exe 组件仍驻留在自动生成的 wxs 文件中。如果不修改自动生成的代码,我将如何解决这个问题?

0 投票
10 回答
91020 浏览

javascript - 如何将 JavaScript 键盘快捷键添加到现有 JavaScript 函数?

这是我的代码:

我想为这段代码添加一个键盘快捷键,我该怎么做才能在单击按钮时也执行该功能?

试图添加一个 else if 语句,但它不起作用,有什么想法吗?

0 投票
2 回答
721 浏览

c# - 在 C# 中获取启动快捷方式

假设我有一个可执行文件,当它启动时,我想知道它是如何启动的。即我想知道它是从快捷方式开始还是直接开始。有了这个:

我可以获得可执行文件的路径,但这始终是相同的,即使它是通过快捷方式启动的。

假设我的可执行文件名为 c:\text.exe 我直接启动它,然后 test = 'c:\test.exe' 如果我创建一个快捷方式,即 c:\shortcut.lnk (目标 c:\test.exe ) 我希望测试是 'c:\shortcut.exe' 但它是 'c:\test.exe'

我强烈怀疑这是不可能的,因为操作系统处理快捷方式部分,而可执行文件永远看不到差异,但也许有人有创意?