Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
af7a302c
Kaydet (Commit)
af7a302c
authored
Eyl 29, 2002
tarafından
Tony Lownds
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Mac users now see correct modifiers in the Key Binding Entry window.
üst
6565b261
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
29 deletions
+35
-29
keybindingDialog.py
Lib/idlelib/keybindingDialog.py
+35
-29
No files found.
Lib/idlelib/keybindingDialog.py
Dosyayı görüntüle @
af7a302c
...
@@ -26,12 +26,12 @@ class GetKeysDialog(Toplevel):
...
@@ -26,12 +26,12 @@ class GetKeysDialog(Toplevel):
self
.
result
=
''
self
.
result
=
''
self
.
keyString
=
StringVar
(
self
)
self
.
keyString
=
StringVar
(
self
)
self
.
keyString
.
set
(
''
)
self
.
keyString
.
set
(
''
)
self
.
keyCtrl
=
StringVar
(
self
)
self
.
SetModifiersForPlatform
(
)
self
.
keyCtrl
.
set
(
''
)
self
.
modifier_vars
=
[]
self
.
keyAlt
=
StringVar
(
self
)
for
modifier
in
self
.
modifiers
:
self
.
keyAlt
.
set
(
''
)
variable
=
StringVar
(
self
)
self
.
keyShift
=
StringVar
(
self
)
variable
.
set
(
''
)
self
.
keyShift
.
set
(
''
)
self
.
modifier_vars
.
append
(
variable
)
self
.
CreateWidgets
()
self
.
CreateWidgets
()
self
.
LoadFinalKeyList
()
self
.
LoadFinalKeyList
()
self
.
withdraw
()
#hide while setting geometry
self
.
withdraw
()
#hide while setting geometry
...
@@ -74,18 +74,16 @@ class GetKeysDialog(Toplevel):
...
@@ -74,18 +74,16 @@ class GetKeysDialog(Toplevel):
labelKeysBasic
=
Label
(
self
.
frameKeySeqBasic
,
justify
=
LEFT
,
labelKeysBasic
=
Label
(
self
.
frameKeySeqBasic
,
justify
=
LEFT
,
textvariable
=
self
.
keyString
,
relief
=
GROOVE
,
borderwidth
=
2
)
textvariable
=
self
.
keyString
,
relief
=
GROOVE
,
borderwidth
=
2
)
labelKeysBasic
.
pack
(
ipadx
=
5
,
ipady
=
5
,
fill
=
X
)
labelKeysBasic
.
pack
(
ipadx
=
5
,
ipady
=
5
,
fill
=
X
)
checkCtrl
=
Checkbutton
(
self
.
frameControlsBasic
,
self
.
modifier_checkbuttons
=
{}
column
=
0
for
modifier
,
variable
in
zip
(
self
.
modifiers
,
self
.
modifier_vars
):
label
=
self
.
modifier_label
.
get
(
modifier
,
modifier
)
check
=
Checkbutton
(
self
.
frameControlsBasic
,
command
=
self
.
BuildKeyString
,
command
=
self
.
BuildKeyString
,
text
=
'Ctrl'
,
variable
=
self
.
keyCtrl
,
onvalue
=
'Control'
,
offvalue
=
''
)
text
=
label
,
variable
=
variable
,
onvalue
=
modifier
,
offvalue
=
''
)
checkCtrl
.
grid
(
row
=
0
,
column
=
0
,
padx
=
2
,
sticky
=
W
)
check
.
grid
(
row
=
0
,
column
=
column
,
padx
=
2
,
sticky
=
W
)
checkAlt
=
Checkbutton
(
self
.
frameControlsBasic
,
self
.
modifier_checkbuttons
[
modifier
]
=
check
command
=
self
.
BuildKeyString
,
column
+=
1
text
=
'Alt'
,
variable
=
self
.
keyAlt
,
onvalue
=
'Alt'
,
offvalue
=
''
)
checkAlt
.
grid
(
row
=
0
,
column
=
1
,
padx
=
2
,
sticky
=
W
)
checkShift
=
Checkbutton
(
self
.
frameControlsBasic
,
command
=
self
.
BuildKeyString
,
text
=
'Shift'
,
variable
=
self
.
keyShift
,
onvalue
=
'Shift'
,
offvalue
=
''
)
checkShift
.
grid
(
row
=
0
,
column
=
3
,
padx
=
2
,
sticky
=
W
)
labelFnAdvice
=
Label
(
self
.
frameControlsBasic
,
justify
=
LEFT
,
labelFnAdvice
=
Label
(
self
.
frameControlsBasic
,
justify
=
LEFT
,
text
=
"Select the desired modifier
\n
"
+
text
=
"Select the desired modifier
\n
"
+
"keys above, and final key
\n
"
+
"keys above, and final key
\n
"
+
...
@@ -119,6 +117,21 @@ class GetKeysDialog(Toplevel):
...
@@ -119,6 +117,21 @@ class GetKeysDialog(Toplevel):
"separated by a space, eg., <Alt-v> <Meta-v>."
)
"separated by a space, eg., <Alt-v> <Meta-v>."
)
labelHelpAdvanced
.
grid
(
row
=
0
,
column
=
0
,
sticky
=
NSEW
)
labelHelpAdvanced
.
grid
(
row
=
0
,
column
=
0
,
sticky
=
NSEW
)
def
SetModifiersForPlatform
(
self
):
"""Determine list of names of key modifiers for this platform.
The names are used to build Tk bindings -- it doesn't matter if the
keyboard has these keys, it matters if Tk understands them. The
order is also important: key binding equality depends on it, so
config-keys.def must use the same ordering.
"""
import
sys
if
sys
.
platform
==
'darwin'
and
sys
.
executable
.
count
(
'.app'
):
self
.
modifiers
=
[
'Shift'
,
'Control'
,
'Option'
,
'Command'
]
else
:
self
.
modifiers
=
[
'Control'
,
'Alt'
,
'Shift'
]
self
.
modifier_label
=
{
'Control'
:
'Ctrl'
}
def
ToggleLevel
(
self
):
def
ToggleLevel
(
self
):
if
self
.
buttonLevel
.
cget
(
'text'
)[:
8
]
==
'Advanced'
:
if
self
.
buttonLevel
.
cget
(
'text'
)[:
8
]
==
'Advanced'
:
self
.
ClearKeySeq
()
self
.
ClearKeySeq
()
...
@@ -152,22 +165,15 @@ class GetKeysDialog(Toplevel):
...
@@ -152,22 +165,15 @@ class GetKeysDialog(Toplevel):
self
.
keyString
.
set
(
keyStr
)
self
.
keyString
.
set
(
keyStr
)
def
GetModifiers
(
self
):
def
GetModifiers
(
self
):
modList
=
[]
modList
=
[
variable
.
get
()
for
variable
in
self
.
modifier_vars
]
ctrl
=
self
.
keyCtrl
.
get
()
return
filter
(
None
,
modList
)
alt
=
self
.
keyAlt
.
get
()
shift
=
self
.
keyShift
.
get
()
if
ctrl
:
modList
.
append
(
ctrl
)
if
alt
:
modList
.
append
(
alt
)
if
shift
:
modList
.
append
(
shift
)
return
modList
def
ClearKeySeq
(
self
):
def
ClearKeySeq
(
self
):
self
.
listKeysFinal
.
select_clear
(
0
,
END
)
self
.
listKeysFinal
.
select_clear
(
0
,
END
)
self
.
listKeysFinal
.
yview
(
MOVETO
,
'0.0'
)
self
.
listKeysFinal
.
yview
(
MOVETO
,
'0.0'
)
self
.
keyCtrl
.
set
(
''
)
for
variable
in
self
.
modifier_vars
:
self
.
keyAlt
.
set
(
''
),
variable
.
set
(
''
)
self
.
keyShift
.
set
(
''
)
self
.
keyString
.
set
(
''
)
self
.
keyString
.
set
(
''
)
def
LoadFinalKeyList
(
self
):
def
LoadFinalKeyList
(
self
):
#these tuples are also available for use in validity checks
#these tuples are also available for use in validity checks
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment