Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
interface
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
homeostasis
interface
Commits
5f177adc
Commit
5f177adc
authored
10 years ago
by
Benoit Favre
Browse files
Options
Downloads
Patches
Plain Diff
add global keybindings
parent
908d037e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README
+1
-1
1 addition, 1 deletion
README
asr.py
+3
-3
3 additions, 3 deletions
asr.py
main.py
+32
-0
32 additions, 0 deletions
main.py
with
36 additions
and
4 deletions
README
+
1
−
1
View file @
5f177adc
...
@@ -46,6 +46,7 @@ DONE click action = perform action
...
@@ -46,6 +46,7 @@ DONE click action = perform action
DONE add thread for slu
DONE add thread for slu
DONE remove section changer UI
DONE remove section changer UI
DONE change xml view to reflect already performed actions, already recognized text
DONE change xml view to reflect already performed actions, already recognized text
DONE add global keybindings (1-9 for sections, y/n)...
events = click action or words to resynchronize ?
events = click action or words to resynchronize ?
click line = synchronize to that line
click line = synchronize to that line
...
@@ -55,4 +56,3 @@ add logger
...
@@ -55,4 +56,3 @@ add logger
move slu to asr
move slu to asr
make selector a proper window
make selector a proper window
allow sequence advance in slu, add UI for that
allow sequence advance in slu, add UI for that
add global keybindings (1-9 for sections, y/n)...
This diff is collapsed.
Click to expand it.
asr.py
+
3
−
3
View file @
5f177adc
...
@@ -167,12 +167,12 @@ class ASR(Gtk.HBox):
...
@@ -167,12 +167,12 @@ class ASR(Gtk.HBox):
def
button_clicked
(
self
,
button
):
def
button_clicked
(
self
,
button
):
"""
Handle button presses.
"""
"""
Handle button presses.
"""
if
button
.
get_label
()
==
"
Record
"
:
if
self
.
button
.
get_label
()
==
"
Record
"
:
button
.
set_label
(
"
Stop
"
)
self
.
button
.
set_label
(
"
Stop
"
)
self
.
asr
.
set_property
(
"
silent
"
,
False
)
self
.
asr
.
set_property
(
"
silent
"
,
False
)
self
.
hyp
=
[]
self
.
hyp
=
[]
self
.
buffer
.
set_text
(
'
...
'
)
self
.
buffer
.
set_text
(
'
...
'
)
else
:
else
:
button
.
set_label
(
"
Record
"
)
self
.
button
.
set_label
(
"
Record
"
)
self
.
asr
.
set_property
(
"
silent
"
,
True
)
self
.
asr
.
set_property
(
"
silent
"
,
True
)
This diff is collapsed.
Click to expand it.
main.py
+
32
−
0
View file @
5f177adc
...
@@ -78,6 +78,38 @@ class ScriptedASR(Gtk.Window):
...
@@ -78,6 +78,38 @@ class ScriptedASR(Gtk.Window):
self
.
kept_history
=
''
self
.
kept_history
=
''
self
.
kept_actions
=
[]
self
.
kept_actions
=
[]
self
.
connect
(
'
key-press-event
'
,
self
.
global_keybindings
)
def
global_keybindings
(
self
,
widget
,
event
):
if
event
.
keyval
==
Gdk
.
KEY_1
:
self
.
set_section
(
0
)
elif
event
.
keyval
==
Gdk
.
KEY_2
:
self
.
set_section
(
1
)
elif
event
.
keyval
==
Gdk
.
KEY_3
:
self
.
set_section
(
2
)
elif
event
.
keyval
==
Gdk
.
KEY_4
:
self
.
set_section
(
3
)
elif
event
.
keyval
==
Gdk
.
KEY_5
:
self
.
set_section
(
4
)
elif
event
.
keyval
==
Gdk
.
KEY_6
:
self
.
set_section
(
5
)
elif
event
.
keyval
==
Gdk
.
KEY_7
:
self
.
set_section
(
6
)
elif
event
.
keyval
==
Gdk
.
KEY_8
:
self
.
set_section
(
7
)
elif
event
.
keyval
==
Gdk
.
KEY_9
:
self
.
set_section
(
8
)
elif
event
.
keyval
==
Gdk
.
KEY_y
:
self
.
confirmer
.
click_yes
()
elif
event
.
keyval
==
Gdk
.
KEY_n
:
self
.
confirmer
.
click_no
()
elif
event
.
keyval
==
Gdk
.
KEY_space
:
if
not
self
.
asr
.
button
.
has_focus
():
self
.
asr
.
button_clicked
(
None
)
else
:
return
True
return
False
def
set_section
(
self
,
section_id
):
def
set_section
(
self
,
section_id
):
self
.
xmlview
.
set_section
(
section_id
)
self
.
xmlview
.
set_section
(
section_id
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment