Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
幽默龙
luyten
提交
f1ccf991
L
luyten
项目概览
幽默龙
/
luyten
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
luyten
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
f1ccf991
编写于
4月 15, 2019
作者:
D
Deathmarine
提交者:
GitHub
4月 15, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #142 from vlsi/mac_meta_key
use META (cmd) key instead of CTRL for macOS
上级
577c8124
00cc8f7d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
29 addition
and
8 deletion
+29
-8
src/us/deathmarine/luyten/Keymap.java
src/us/deathmarine/luyten/Keymap.java
+14
-0
src/us/deathmarine/luyten/LuytenOsx.java
src/us/deathmarine/luyten/LuytenOsx.java
+0
-3
src/us/deathmarine/luyten/MainMenuBar.java
src/us/deathmarine/luyten/MainMenuBar.java
+1
-1
src/us/deathmarine/luyten/Model.java
src/us/deathmarine/luyten/Model.java
+1
-1
src/us/deathmarine/luyten/OpenFile.java
src/us/deathmarine/luyten/OpenFile.java
+3
-3
src/us/deathmarine/luyten/SystemInfo.java
src/us/deathmarine/luyten/SystemInfo.java
+10
-0
未找到文件。
src/us/deathmarine/luyten/Keymap.java
0 → 100644
浏览文件 @
f1ccf991
package
us.deathmarine.luyten
;
import
java.awt.event.InputEvent
;
public
final
class
Keymap
{
/**
* Ctrl+click defaults to "context menu" in macOS, so META+click is used there.
*
* @return META_DOWN_MASK for macOS, CTRL_DOWN_MASK otherwise
*/
public
static
int
ctrlDownModifier
()
{
return
SystemInfo
.
IS_MAC
?
InputEvent
.
META_DOWN_MASK
:
InputEvent
.
CTRL_DOWN_MASK
;
}
}
src/us/deathmarine/luyten/LuytenOsx.java
浏览文件 @
f1ccf991
...
...
@@ -10,9 +10,6 @@ import com.apple.eawt.ApplicationEvent;
*/
public
class
LuytenOsx
extends
Luyten
{
public
static
void
main
(
String
[]
args
)
{
// Set a flag that says we are running in OS X
System
.
setProperty
(
"us.deathmarine.luyten.Luyten.running_in_osx"
,
"true"
);
// Add an adapter as the handler to a new instance of the application
// class
@SuppressWarnings
(
"deprecation"
)
...
...
src/us/deathmarine/luyten/MainMenuBar.java
浏览文件 @
f1ccf991
...
...
@@ -249,7 +249,7 @@ public class MainMenuBar extends JMenuBar {
// Only add the exit command for non-OS X. OS X handles its close
// automatically
if
(!
(
"true"
.
equals
(
System
.
getProperty
(
"us.deathmarine.luyten.Luyten.running_in_osx"
))
))
{
if
(!
Boolean
.
getBoolean
(
"apple.laf.useScreenMenuBar"
))
{
menuItem
=
new
JMenuItem
(
"Exit"
);
menuItem
.
setAccelerator
(
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_F4
,
ActionEvent
.
ALT_MASK
));
menuItem
.
addActionListener
(
new
ActionListener
()
{
...
...
src/us/deathmarine/luyten/Model.java
浏览文件 @
f1ccf991
...
...
@@ -153,7 +153,7 @@ public class Model extends JSplitPane {
}
});
KeyStroke
sfuncF4
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_F4
,
InputEvent
.
CTRL_DOWN_MASK
,
false
);
KeyStroke
sfuncF4
=
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_F4
,
Keymap
.
ctrlDownModifier
()
,
false
);
mainWindow
.
getRootPane
().
getInputMap
(
JComponent
.
WHEN_IN_FOCUSED_WINDOW
).
put
(
sfuncF4
,
"CloseTab"
);
mainWindow
.
getRootPane
().
getActionMap
().
put
(
"CloseTab"
,
new
AbstractAction
()
{
...
...
src/us/deathmarine/luyten/OpenFile.java
浏览文件 @
f1ccf991
...
...
@@ -193,7 +193,7 @@ public class OpenFile implements SyntaxConstants {
}
textArea
.
setHyperlinksEnabled
(
true
);
textArea
.
setLinkScanningMask
(
InputEvent
.
CTRL_DOWN_MASK
);
textArea
.
setLinkScanningMask
(
Keymap
.
ctrlDownModifier
()
);
textArea
.
setLinkGenerator
(
new
LinkGenerator
()
{
@Override
...
...
@@ -240,7 +240,7 @@ public class OpenFile implements SyntaxConstants {
return
;
}
if
((
e
.
getModifiersEx
()
&
InputEvent
.
CTRL_DOWN_MASK
)
!=
0
)
{
if
((
e
.
getModifiersEx
()
&
Keymap
.
ctrlDownModifier
()
)
!=
0
)
{
Font
font
=
textArea
.
getFont
();
int
size
=
font
.
getSize
();
if
(
e
.
getWheelRotation
()
>
0
)
{
...
...
@@ -410,7 +410,7 @@ public class OpenFile implements SyntaxConstants {
public
synchronized
void
mouseMoved
(
MouseEvent
e
)
{
String
linkText
=
null
;
boolean
isLinkLabel
=
false
;
boolean
isCtrlDown
=
(
e
.
getModifiersEx
()
&
InputEvent
.
CTRL_DOWN_MASK
)
!=
0
;
boolean
isCtrlDown
=
(
e
.
getModifiersEx
()
&
Keymap
.
ctrlDownModifier
()
)
!=
0
;
if
(
isCtrlDown
)
{
linkText
=
createLinkLabel
(
e
);
isLinkLabel
=
linkText
!=
null
;
...
...
src/us/deathmarine/luyten/SystemInfo.java
0 → 100644
浏览文件 @
f1ccf991
package
us.deathmarine.luyten
;
import
java.util.Locale
;
public
class
SystemInfo
{
private
static
final
String
OS_NAME
=
System
.
getProperty
(
"os.name"
);
private
static
final
String
OS_NAME_LOWER
=
OS_NAME
.
toLowerCase
(
Locale
.
US
);
public
static
boolean
IS_MAC
=
OS_NAME_LOWER
.
startsWith
(
"mac"
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录